00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef BOOST_UTILITY_COMPARE_POINTEES_25AGO2003_HPP
00013 #define BOOST_UTILITY_COMPARE_POINTEES_25AGO2003_HPP
00014
00015 #include<functional>
00016
00017 namespace boost {
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 template<class OptionalPointee>
00029 inline
00030 bool equal_pointees ( OptionalPointee const& x, OptionalPointee const& y )
00031 {
00032 return (!x) != (!y) ? false : ( !x ? true : (*x) == (*y) ) ;
00033 }
00034
00035 template<class OptionalPointee>
00036 struct equal_pointees_t : std::binary_function<OptionalPointee,OptionalPointee,bool>
00037 {
00038 bool operator() ( OptionalPointee const& x, OptionalPointee const& y ) const
00039 { return equal_pointees(x,y) ; }
00040 } ;
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 template<class OptionalPointee>
00052 inline
00053 bool less_pointees ( OptionalPointee const& x, OptionalPointee const& y )
00054 {
00055 return !y ? false : ( !x ? true : (*x) < (*y) ) ;
00056 }
00057
00058 template<class OptionalPointee>
00059 struct less_pointees_t : std::binary_function<OptionalPointee,OptionalPointee,bool>
00060 {
00061 bool operator() ( OptionalPointee const& x, OptionalPointee const& y ) const
00062 { return less_pointees(x,y) ; }
00063 } ;
00064
00065 }
00066
00067 #endif
00068