Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2008-05-27 21:44:09


Author: eric_niebler
Date: 2008-05-27 21:44:08 EDT (Tue, 27 May 2008)
New Revision: 45847
URL: http://svn.boost.org/trac/boost/changeset/45847

Log:
fix bug in result_of calculation of members
Text files modified:
   branches/proto/v4/boost/proto/detail/decltype.hpp | 8 +++++---
   1 files changed, 5 insertions(+), 3 deletions(-)

Modified: branches/proto/v4/boost/proto/detail/decltype.hpp
==============================================================================
--- branches/proto/v4/boost/proto/detail/decltype.hpp (original)
+++ branches/proto/v4/boost/proto/detail/decltype.hpp 2008-05-27 21:44:08 EDT (Tue, 27 May 2008)
@@ -16,9 +16,11 @@
 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
 #include <boost/mpl/if.hpp>
+#include <boost/type_traits/remove_cv.hpp>
 #include <boost/type_traits/is_function.hpp>
 #include <boost/typeof/typeof.hpp>
 #include <boost/utility/result_of.hpp>
+#include <boost/utility/enable_if.hpp>
 #include <boost/proto/detail/suffix.hpp> // must be last include
 
 // If we're generating doxygen documentation, hide all the nasty
@@ -137,19 +139,19 @@
         };
 
         ////////////////////////////////////////////////////////////////////////////////////////////
- template<typename T>
+ template<typename T, typename Void = void>
         struct result_of_
           : boost::result_of<T>
         {};
 
         template<typename T, typename U, typename V>
- struct result_of_<T U::*(V)>
+ struct result_of_<T U::*(V), typename disable_if<is_function<typename remove_cv<T>::type> >::type>
         {
             typedef T type;
         };
 
         template<typename T, typename U, typename V>
- struct result_of_<T U::*(V &)>
+ struct result_of_<T U::*(V &), typename disable_if<is_function<typename remove_cv<T>::type> >::type>
         {
             typedef T &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