vtf-logo

Address.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00010 #if !defined(__ads_Address_h__)
00011 #define __ads_Address_h__
00012 
00013 #include "../defs.h"
00014 
00015 //#include <iterator>
00016 #include <functional>
00017 
00018 BEGIN_NAMESPACE_ADS
00019 
00020 //-----------------------------------------------------------------------------
00022 // @{
00023 
00025 
00028 template <typename Object>
00029 struct Address : 
00030   public std::unary_function<Object,Object*> {
00032   typedef typename std::unary_function<Object,Object*>::result_type 
00033   result_type;
00034 
00036   result_type
00037   operator()( Object& x ) const 
00038   { 
00039     return &x;
00040   }
00041 };
00042 
00044 
00056 template <typename Object>
00057 inline
00058 Address<Object>
00059 address() {
00060   return Address<Object>();
00061 }
00062 
00063 // @}
00064 
00065 END_NAMESPACE_ADS
00066 
00067 #endif

Generated on Fri Aug 24 12:55:21 2007 for Algorithms and Data Structures Package by  doxygen 1.4.7