diff --git a/inst/include/cpp11/as.hpp b/inst/include/cpp11/as.hpp index aa41b13b..a02c7588 100644 --- a/inst/include/cpp11/as.hpp +++ b/inst/include/cpp11/as.hpp @@ -2,6 +2,7 @@ #include // for modf #include // for initializer_list +#include // for std::shared_ptr, std::weak_ptr, std::unique_ptr #include // for string, basic_string #include // for decay, enable_if, is_same, is_convertible @@ -16,9 +17,23 @@ using enable_if_t = typename std::enable_if::type; template using decay_t = typename std::decay::type; +template +struct is_smart_ptr : std::false_type {}; + +template +struct is_smart_ptr> : std::true_type {}; + +template +struct is_smart_ptr> : std::true_type {}; + +template +struct is_smart_ptr> : std::true_type {}; + template using enable_if_constructible_from_sexp = - enable_if_t::value && std::is_constructible::value, R>; + enable_if_t::value && // workaround for gcc 4.8 + std::is_class::value && std::is_constructible::value, + R>; template using enable_if_is_sexp = enable_if_t::value, R>;