17
17
#include " boost/type_traits/remove_cv.hpp"
18
18
#include " boost/type_traits/is_pointer.hpp"
19
19
20
+ #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
21
+ #include < utility>
22
+ #endif
23
+
20
24
namespace boost {
21
25
namespace lambda {
22
26
@@ -28,6 +32,12 @@ template<class T> struct constructor {
28
32
29
33
template <class U > struct sig { typedef T type; };
30
34
35
+ #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
36
+ template <class ... Args>
37
+ T operator ()(Args&&... args) const {
38
+ return T (std::forward<Args>(args)...);
39
+ }
40
+ #else
31
41
T operator ()() const {
32
42
return T ();
33
43
}
@@ -81,6 +91,7 @@ template<class T> struct constructor {
81
91
T operator ()(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7, A8& a8, A9& a9, A10& a10) const {
82
92
return T (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
83
93
}
94
+ #endif
84
95
85
96
};
86
97
@@ -137,6 +148,12 @@ template<class T> struct new_ptr {
137
148
138
149
template <class U > struct sig { typedef T* type; };
139
150
151
+ #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
152
+ template <class ... Args>
153
+ T* operator ()(Args&&... args) const {
154
+ return new T (std::forward<Args>(args)...);
155
+ }
156
+ #else
140
157
T* operator ()() const {
141
158
return new T ();
142
159
}
@@ -190,6 +207,7 @@ template<class T> struct new_ptr {
190
207
T* operator ()(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7, A8& a8, A9& a9, A10& a10) const {
191
208
return new T (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
192
209
}
210
+ #endif
193
211
194
212
};
195
213
0 commit comments