File tree Expand file tree Collapse file tree 2 files changed +13
-16
lines changed Expand file tree Collapse file tree 2 files changed +13
-16
lines changed Original file line number Diff line number Diff line change 23
23
namespace Rcpp {
24
24
namespace traits {
25
25
26
- template <typename T>
27
- class _has_copy_constructor_helper : __sfinae_types {
28
- template <typename U> struct _Wrap_type { };
29
-
30
- template <typename U>
31
- static __one __test (U);
32
-
33
- template <typename U>
34
- static __two __test (...);
35
-
36
- public:
37
- static const bool value = sizeof (__test<T>(0 )) == 1 ;
38
- };
39
-
40
- template <typename T> struct has_copy_constructor :
41
- integral_constant<bool ,_has_copy_constructor_helper<T>::value> { };
26
+ #if defined(RCPP_USING_CXX11)
27
+ template <typename T> struct has_copy_constructor :
28
+ integral_constant<bool , std::is_copy_constructible<T>::value >{} ;
29
+ #else
30
+ template <typename T> struct has_copy_constructor : true_type ;
31
+ #endif
42
32
43
33
} // traits
44
34
} // Rcpp
Original file line number Diff line number Diff line change @@ -119,6 +119,13 @@ class ModuleCopyConstructor {
119
119
} ;
120
120
121
121
RCPP_EXPOSED_CLASS (ModuleTest)
122
+
123
+ namespace Rcpp {
124
+ namespace traits {
125
+ template <> struct has_copy_constructor <ModuleTest> : false_type ;
126
+ }
127
+ }
128
+
122
129
class ModuleTest {
123
130
public:
124
131
double value;
You can’t perform that action at this time.
0 commit comments