12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- #ifndef BOOST_UTILITY_COMPARE_POINTEES_25AGO2003_HPP
- #define BOOST_UTILITY_COMPARE_POINTEES_25AGO2003_HPP
- #include<functional>
- namespace boost {
- template<class OptionalPointee>
- inline
- bool equal_pointees ( OptionalPointee const& x, OptionalPointee const& y )
- {
- return (!x) != (!y) ? false : ( !x ? true : (*x) == (*y) ) ;
- }
- template<class OptionalPointee>
- struct equal_pointees_t
- {
- typedef bool result_type;
- typedef OptionalPointee first_argument_type;
- typedef OptionalPointee second_argument_type;
- bool operator() ( OptionalPointee const& x, OptionalPointee const& y ) const
- { return equal_pointees(x,y) ; }
- } ;
- template<class OptionalPointee>
- inline
- bool less_pointees ( OptionalPointee const& x, OptionalPointee const& y )
- {
- return !y ? false : ( !x ? true : (*x) < (*y) ) ;
- }
- template<class OptionalPointee>
- struct less_pointees_t
- {
- typedef bool result_type;
- typedef OptionalPointee first_argument_type;
- typedef OptionalPointee second_argument_type;
- bool operator() ( OptionalPointee const& x, OptionalPointee const& y ) const
- { return less_pointees(x,y) ; }
- } ;
- }
- #endif
|