Update of /cvsroot/boost/boost/boost/function
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14024

Modified Files:
        function_base.hpp 
Log Message:
Try to work around EC++4 bug

Index: function_base.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/function/function_base.hpp,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -d -r1.89 -r1.90
--- function_base.hpp   13 Oct 2006 14:29:56 -0000      1.89
+++ function_base.hpp   18 Apr 2007 12:13:53 -0000      1.90
@@ -30,6 +30,14 @@
 #endif
 #include <boost/function_equal.hpp>
 
+// Define BOOST_FUNCTION_STD_NS to the namespace that contains type_info.
+#ifdef BOOST_NO_EXCEPTION_STD_NAMESPACE
+// Embedded VC++ does not have type_info in namespace std
+#  define BOOST_FUNCTION_STD_NS
+#else
+#  define BOOST_FUNCTION_STD_NS std
+#endif
+
 // Borrowed from Boost.Python library: determines the cases where we
 // need to use std::type_info::name to compare instead of operator==.
 # if (defined(__GNUC__) && __GNUC__ >= 3) \
@@ -215,8 +223,8 @@
               // DPG TBD: Since we're only storing a pointer, it's
               // possible that the user could ask for a base class or
               // derived class. Is that okay?
-              const std::type_info& check_type = 
-                *static_cast<const std::type_info*>(out_buffer.const_obj_ptr);
+              const BOOST_FUNCTION_STD_NS::type_info& check_type = 
+                *static_cast<const 
BOOST_FUNCTION_STD_NS::type_info*>(out_buffer.const_obj_ptr);
               if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(F)))
                 out_buffer.obj_ptr = in_buffer.obj_ptr;
               else
@@ -265,8 +273,8 @@
           else if (op == destroy_functor_tag)
             out_buffer.func_ptr = 0;
           else /* op == check_functor_type_tag */ {
-            const std::type_info& check_type = 
-              *static_cast<const std::type_info*>(out_buffer.const_obj_ptr);
+            const BOOST_FUNCTION_STD_NS::type_info& check_type = 
+              *static_cast<const 
BOOST_FUNCTION_STD_NS::type_info*>(out_buffer.const_obj_ptr);
             if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor)))
               out_buffer.obj_ptr = &in_buffer.func_ptr;
             else
@@ -287,8 +295,8 @@
             // Some compilers (Borland, vc6, ...) are unhappy with 
~functor_type.
             reinterpret_cast<functor_type*>(&out_buffer.data)->~Functor();
           } else /* op == check_functor_type_tag */ {
-            const std::type_info& check_type = 
-              *static_cast<const std::type_info*>(out_buffer.const_obj_ptr);
+            const BOOST_FUNCTION_STD_NS::type_info& check_type = 
+              *static_cast<const 
BOOST_FUNCTION_STD_NS::type_info*>(out_buffer.const_obj_ptr);
             if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor)))
               out_buffer.obj_ptr = &in_buffer.data;
             else
@@ -348,8 +356,8 @@
 #  endif // BOOST_NO_STD_ALLOCATOR
             out_buffer.obj_ptr = 0;
           } else /* op == check_functor_type_tag */ {
-            const std::type_info& check_type = 
-              *static_cast<const std::type_info*>(out_buffer.const_obj_ptr);
+            const BOOST_FUNCTION_STD_NS::type_info& check_type = 
+              *static_cast<const 
BOOST_FUNCTION_STD_NS::type_info*>(out_buffer.const_obj_ptr);
             if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor)))
               out_buffer.obj_ptr = in_buffer.obj_ptr;
             else
@@ -480,13 +488,13 @@
 
   /** Retrieve the type of the stored function object, or typeid(void)
       if this is empty. */
-  const std::type_info& target_type() const
+  const BOOST_FUNCTION_STD_NS::type_info& target_type() const
   {
     if (!vtable) return typeid(void);
 
     detail::function::function_buffer type;
     vtable->manager(functor, type, detail::function::get_functor_type_tag);
-    return *static_cast<const std::type_info*>(type.const_obj_ptr);
+    return *static_cast<const 
BOOST_FUNCTION_STD_NS::type_info*>(type.const_obj_ptr);
   }
 
   template<typename Functor>


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to