123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- #ifndef BOOST_IDENTIFIER_HPP
- #define BOOST_IDENTIFIER_HPP
- #include <boost/utility/enable_if.hpp>
- #include <boost/type_traits/is_base_of.hpp>
- #include <iosfwd>
- namespace boost
- {
- namespace detail
- {
-
-
-
-
-
-
-
- template <typename T, typename D>
- class identifier
- {
- public:
- typedef T value_type;
- const value_type value() const { return m_value; }
- void assign( value_type v ) { m_value = v; }
- bool operator==( const D & rhs ) const { return m_value == rhs.m_value; }
- bool operator!=( const D & rhs ) const { return m_value != rhs.m_value; }
- bool operator< ( const D & rhs ) const { return m_value < rhs.m_value; }
- bool operator<=( const D & rhs ) const { return m_value <= rhs.m_value; }
- bool operator> ( const D & rhs ) const { return m_value > rhs.m_value; }
- bool operator>=( const D & rhs ) const { return m_value >= rhs.m_value; }
- typedef void (*unspecified_bool_type)(D);
- static void unspecified_bool_true(D){}
-
- operator unspecified_bool_type() const { return m_value == value_type() ? 0 : unspecified_bool_true; }
- bool operator!() const { return m_value == value_type(); }
-
- protected:
- identifier() {}
- explicit identifier( value_type v ) : m_value(v) {}
- private:
- T m_value;
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- }
- #endif
|