$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Tobias Schwinger (tschwinger_at_[hidden])
Date: 2006-05-16 08:31:07
Tobias Schwinger wrote:
> WHAT:
> =====
> 
> The patch changes the internal pair concept, so STL pairs and Fusion 
> pairs also work as MPL pairs.
> 
> STL pair:  first       (value)
>  second      (value)
>  first_type  (type)
>  second_type (type)
> 
> Fusion pair:
>  second      (value)
>  first_type  (type)
>  second_type (type)
> 
> MPL pair (CVS):
>  first       (type)
>  second      (type)
> 
> MPL pair (after applying this patch):
>  first_type  (type)
>  second_type (type)
> 
Boost.Variant uses MPL implementation details directly, so here's a dependent patch.
Verified with Variant test suite.
Regards,
Tobias
Index: boost/variant/variant.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/variant/variant.hpp,v
retrieving revision 1.96
diff -u -r1.96 variant.hpp
--- boost/variant/variant.hpp	25 Aug 2005 16:27:26 -0000	1.96
+++ boost/variant/variant.hpp	16 May 2006 11:30:55 -0000
@@ -166,8 +166,8 @@
         , mpl::protect< find_fallback_type_pred >
         >::type first_result_;
 
-    typedef typename first_result_::first first_result_index;
-    typedef typename first_result_::second first_result_it;
+    typedef typename first_result_::first_type first_result_index;
+    typedef typename first_result_::second_type first_result_it;
 
     // [...now search the rest of the sequence for boost::blank...]
 
@@ -177,7 +177,7 @@
         , mpl::protect< mpl::not_same_as<boost::blank> >
         >::type second_result_;
 
-    typedef typename second_result_::second second_result_it;
+    typedef typename second_result_::second_type second_result_it;
 
 public: // metafunction result
 
@@ -1054,9 +1054,9 @@
           internal_types
         >::type fallback_type_result_;
 
-    typedef typename fallback_type_result_::first
+    typedef typename fallback_type_result_::first_type
         fallback_type_index_;
-    typedef typename fallback_type_result_::second
+    typedef typename fallback_type_result_::second_type
         fallback_type_;
 
     struct has_fallback_type_
Index: boost/variant/detail/initializer.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/variant/detail/initializer.hpp,v
retrieving revision 1.4
diff -u -r1.4 initializer.hpp
--- boost/variant/detail/initializer.hpp	2 Sep 2004 15:41:28 -0000	1.4
+++ boost/variant/detail/initializer.hpp	16 May 2006 11:27:36 -0000
@@ -65,9 +65,9 @@
     {
     private: // helpers, for metafunction result (below)
 
-        typedef typename BaseIndexPair::first
+        typedef typename BaseIndexPair::first_type
             base;
-        typedef typename BaseIndexPair::second
+        typedef typename BaseIndexPair::second_type
             index;
 
         class initializer_node
@@ -224,7 +224,7 @@
         , ::boost::mpl::protect< \
               ::boost::detail::variant::make_initializer_node \
             > \
-        >::type::first \
+        >::type::first_type \
     /**/
 
 #else // defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE)