vtf-logo

Dereference.h

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

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