summaryrefslogtreecommitdiff
blob: 0b800e9266ddc92b35b5679e9eeaf3181c87da23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Index: trunk/boost/lambda/detail/function_adaptors.hpp
===================================================================
--- a/trunk/boost/lambda/detail/function_adaptors.hpp
+++ b/trunk/boost/lambda/detail/function_adaptors.hpp
@@ -17,4 +17,7 @@
 #include "boost/type_traits/same_traits.hpp"
 #include "boost/type_traits/remove_reference.hpp"
+#include "boost/type_traits/remove_cv.hpp"
+#include "boost/type_traits/add_const.hpp"
+#include "boost/type_traits/add_volatile.hpp"
 #include "boost/utility/result_of.hpp"
 
@@ -238,12 +241,14 @@
   template<class Args> class sig { 
     typedef typename boost::tuples::element<1, Args>::type argument_type;
-
-    typedef typename detail::IF<boost::is_const<argument_type>::value,
+    typedef typename boost::remove_reference<
+      argument_type
+    >::type unref_type;
+
+    typedef typename detail::IF<boost::is_const<unref_type>::value,
       typename boost::add_const<T>::type,
       T
     >::RET properly_consted_return_type;
 
-    typedef typename detail::IF<
-        boost::is_volatile<properly_consted_return_type>::value,
+    typedef typename detail::IF<boost::is_volatile<unref_type>::value,
       typename boost::add_volatile<properly_consted_return_type>::type,
       properly_consted_return_type
@@ -252,6 +257,8 @@
 
   public:
-    typedef typename 
-      boost::add_reference<properly_cvd_return_type>::type type;
+    typedef typename detail::IF<boost::is_reference<argument_type>::value,
+      typename boost::add_reference<properly_cvd_return_type>::type,
+      typename boost::remove_cv<T>::type
+    >::RET type;
   };