Warning, file /include/boost/detail/identifier.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_IDENTIFIER_HPP
0011 #define BOOST_IDENTIFIER_HPP
0012
0013 #include <boost/utility/enable_if.hpp>
0014 #include <boost/type_traits/is_base_of.hpp>
0015 #include <iosfwd>
0016
0017 namespace boost
0018 {
0019 namespace detail
0020 {
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 template <typename T, typename D>
0033 class identifier
0034 {
0035 public:
0036 typedef T value_type;
0037
0038 const value_type value() const { return m_value; }
0039 void assign( value_type v ) { m_value = v; }
0040
0041 bool operator==( const D & rhs ) const { return m_value == rhs.m_value; }
0042 bool operator!=( const D & rhs ) const { return m_value != rhs.m_value; }
0043 bool operator< ( const D & rhs ) const { return m_value < rhs.m_value; }
0044 bool operator<=( const D & rhs ) const { return m_value <= rhs.m_value; }
0045 bool operator> ( const D & rhs ) const { return m_value > rhs.m_value; }
0046 bool operator>=( const D & rhs ) const { return m_value >= rhs.m_value; }
0047
0048 typedef void (*unspecified_bool_type)(D);
0049 static void unspecified_bool_true(D){}
0050
0051
0052 operator unspecified_bool_type() const { return m_value == value_type() ? 0 : unspecified_bool_true; }
0053 bool operator!() const { return m_value == value_type(); }
0054
0055
0056 protected:
0057 identifier() {}
0058 explicit identifier( value_type v ) : m_value(v) {}
0059
0060 private:
0061 T m_value;
0062 };
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084 }
0085 }
0086
0087 #endif