Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50240 - trunk/boost/spirit/home/phoenix/bind
From: steven_at_[hidden]
Date: 2008-12-11 10:51:40


Author: steven_watanabe
Date: 2008-12-11 10:51:39 EST (Thu, 11 Dec 2008)
New Revision: 50240
URL: http://svn.boost.org/trac/boost/changeset/50240

Log:
handle more combinations of const/pointer/reference in result<>
Text files modified:
   trunk/boost/spirit/home/phoenix/bind/bind_member_variable.hpp | 27 ++++++++++-----------------
   1 files changed, 10 insertions(+), 17 deletions(-)

Modified: trunk/boost/spirit/home/phoenix/bind/bind_member_variable.hpp
==============================================================================
--- trunk/boost/spirit/home/phoenix/bind/bind_member_variable.hpp (original)
+++ trunk/boost/spirit/home/phoenix/bind/bind_member_variable.hpp 2008-12-11 10:51:39 EST (Thu, 11 Dec 2008)
@@ -7,6 +7,11 @@
 #ifndef PHOENIX_BIND_BIND_MEMBER_VARIABLE_HPP
 #define PHOENIX_BIND_BIND_MEMBER_VARIABLE_HPP
 
+#include <boost/mpl/if.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/remove_pointer.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+
 #include <boost/spirit/home/phoenix/core/actor.hpp>
 #include <boost/spirit/home/phoenix/core/compose.hpp>
 #include <boost/spirit/home/phoenix/core/reference.hpp>
@@ -26,24 +31,12 @@
             template <typename Class>
             struct result
             {
- typedef RT type;
- };
-
- template <typename Class>
- struct result<Class&>
- {
- typedef typename boost::mpl::if_<
- boost::is_const<Class>
- , const RT&
- , RT&
- >::type type;
- };
-
- template <typename Class>
- struct result<Class*>
- {
                 typedef typename boost::mpl::if_<
- boost::is_const<Class>
+ boost::is_const<
+ typename boost::remove_pointer<
+ typename boost::remove_reference<Class>::type
+ >::type
+ >
                   , const RT&
                   , RT&
>::type type;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk