]> git.lyx.org Git - features.git/blobdiff - boost/boost/exception/detail/type_info.hpp
boost: update to 1.42.0
[features.git] / boost / boost / exception / detail / type_info.hpp
index ac0960db68af6a4aee8cb8a731e17ca2eb27d1f9..60709a1f6c08991262c371b7eb9d0085bec401c0 100644 (file)
@@ -5,9 +5,16 @@
 
 #ifndef UUID_C3E1741C754311DDB2834CCA55D89593
 #define UUID_C3E1741C754311DDB2834CCA55D89593
+#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
 
 #include <boost/detail/sp_typeinfo.hpp>
 #include <boost/current_function.hpp>
+#include <boost/config.hpp>
 
 namespace
 boost
@@ -39,92 +46,34 @@ boost
     namespace
     exception_detail
         {
-#ifdef BOOST_NO_TYPEID
         struct
         type_info_
             {
-            detail::sp_typeinfo type_;
-            char const * name_;
-
-            explicit
-            type_info_( detail::sp_typeinfo type, char const * name ):
-                type_(type),
-                name_(name)
-                {
-                }
-
-            friend
-            bool
-            operator==( type_info_ const & a, type_info_ const & b )
-                {
-                return a.type_==b.type_;
-                }
-
-            friend
-            bool
-            operator<( type_info_ const & a, type_info_ const & b )
-                {
-                return a.type_<b.type_;
-                }
-
-            char const *
-            name() const
-                {
-                return name_;
-                }
-            };
-#else
-        struct
-        type_info_
-            {
-            detail::sp_typeinfo const * type_;
+            detail::sp_typeinfo const & type_;
 
             explicit
             type_info_( detail::sp_typeinfo const & type ):
-                type_(&type)
-                {
-                }
-
-            type_info_( detail::sp_typeinfo const & type, char const * ):
-                type_(&type)
-                {
-                }
-
-            friend
-            bool
-            operator==( type_info_ const & a, type_info_ const & b )
+                type_(type)
                 {
-                return (*a.type_)==(*b.type_);
                 }
 
             friend
             bool
             operator<( type_info_ const & a, type_info_ const & b )
                 {
-                return 0!=(a.type_->before(*b.type_));
-                }
-
-            char const *
-            name() const
-                {
-                return type_->name();
+                return 0!=(a.type_.before(b.type_));
                 }
             };
-#endif
-
-        inline
-        bool
-        operator!=( type_info_ const & a, type_info_ const & b )
-            {
-            return !(a==b);
-            }
         }
     }
 
-#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_SP_TYPEID(T),::boost::tag_type_name<T>())
+#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_SP_TYPEID(T))
 
 #ifndef BOOST_NO_RTTI
 #define BOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::boost::exception_detail::type_info_(typeid(x))
 #endif
 
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
+#endif
 #endif