1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- #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) {}
- #if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
- private:
- #endif
- T m_value;
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- }
- #endif
|