$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r81314 - in sandbox/type_erasure: boost/type_erasure/detail libs/type_erasure/test
From: steven_at_[hidden]
Date: 2012-11-12 19:43:59
Author: steven_watanabe
Date: 2012-11-12 19:43:59 EST (Mon, 12 Nov 2012)
New Revision: 81314
URL: http://svn.boost.org/trac/boost/changeset/81314
Log:
Handle const correctly for free functions.
Text files modified: 
   sandbox/type_erasure/boost/type_erasure/detail/const.hpp  |    18 +++++++++++-------                      
   sandbox/type_erasure/libs/type_erasure/test/test_free.cpp |     4 ++--                                    
   2 files changed, 13 insertions(+), 9 deletions(-)
Modified: sandbox/type_erasure/boost/type_erasure/detail/const.hpp
==============================================================================
--- sandbox/type_erasure/boost/type_erasure/detail/const.hpp	(original)
+++ sandbox/type_erasure/boost/type_erasure/detail/const.hpp	2012-11-12 19:43:59 EST (Mon, 12 Nov 2012)
@@ -79,14 +79,18 @@
 struct maybe_const_this_param
 {
     typedef typename ::boost::type_erasure::derived<Base>::type plain_type;
-    typedef typename ::boost::mpl::if_<
-        ::boost::type_erasure::detail::should_be_non_const<Placeholder, Base>,
-        plain_type&,
+    typedef typename ::boost::remove_reference<Placeholder>::type plain_placeholder;
+    typedef typename ::boost::mpl::if_< ::boost::is_reference<Placeholder>,
         typename ::boost::mpl::if_<
-            ::boost::type_erasure::detail::should_be_const<Placeholder, Base>,
-            const plain_type&,
-            uncallable<plain_type>
-        >::type
+            ::boost::type_erasure::detail::should_be_non_const<plain_placeholder, Base>,
+            plain_type&,
+            typename ::boost::mpl::if_<
+                ::boost::type_erasure::detail::should_be_const<plain_placeholder, Base>,
+                const plain_type&,
+                uncallable<plain_type>
+            >::type
+        >::type,
+        plain_type
     >::type type;
 };
 
Modified: sandbox/type_erasure/libs/type_erasure/test/test_free.cpp
==============================================================================
--- sandbox/type_erasure/libs/type_erasure/test/test_free.cpp	(original)
+++ sandbox/type_erasure/libs/type_erasure/test/test_free.cpp	2012-11-12 19:43:59 EST (Mon, 12 Nov 2012)
@@ -61,7 +61,7 @@
         ns1::ns2::ns_has_f1_1<int(const _self&)>,
         copy_constructible<> > concept_type;
     model_const m(10);
-    any<concept_type> x(m);
+    const any<concept_type> x(m);
     BOOST_CHECK_EQUAL(f1(x), 10);
 }
 
@@ -93,7 +93,7 @@
         global_has_f1_2<int(const _self&, int)>,
         copy_constructible<> > concept_type;
     model_const m(10);
-    any<concept_type> x(m);
+    const any<concept_type> x(m);
     BOOST_CHECK_EQUAL(f1(x), 10);
     BOOST_CHECK_EQUAL(f1(x, 5), 15);
 }