summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2014-04-21 22:30:32 +0000
committerMarshall Clow <mclow.lists@gmail.com>2014-04-21 22:30:32 +0000
commit3d3974b45ba78f033f93fbcca749663a2d61eac2 (patch)
treea2f329013765899c13301c9157ee2f023a383dbf
parent70cfa66fe30ef12a29f50c705de8caf631c14f0d (diff)
downloadbcm5719-llvm-3d3974b45ba78f033f93fbcca749663a2d61eac2.tar.gz
bcm5719-llvm-3d3974b45ba78f033f93fbcca749663a2d61eac2.zip
Use compiler intrinsic __is_constructible if available
llvm-svn: 206805
-rw-r--r--libcxx/include/type_traits26
1 files changed, 17 insertions, 9 deletions
diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits
index 8f18aa5fef3..b5f4b3ef560 100644
--- a/libcxx/include/type_traits
+++ b/libcxx/include/type_traits
@@ -2034,10 +2034,24 @@ class _LIBCPP_TYPE_VIS_ONLY result_of<_Fn(_A0, _A1, _A2)>
#endif // _LIBCPP_HAS_NO_VARIADICS
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
// template <class T, class... Args> struct is_constructible;
+namespace __is_construct
+{
+struct __nat {};
+}
+
+#if __has_feature(is_constructible)
+
+template <class _Tp, class ..._Args>
+struct _LIBCPP_TYPE_VIS_ONLY is_constructible
+ : public integral_constant<bool, __is_constructible(_Tp, _Args...)>
+ {};
+
+#else
+
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
// main is_constructible test
template <class _Tp, class ..._Args>
@@ -2265,13 +2279,6 @@ struct __is_constructible2_void_check<true, _Tp, _A0, _A1>
// is_constructible entry point
-namespace __is_construct
-{
-
-struct __nat {};
-
-}
-
template <class _Tp, class _A0 = __is_construct::__nat,
class _A1 = __is_construct::__nat>
struct _LIBCPP_TYPE_VIS_ONLY is_constructible
@@ -2336,6 +2343,7 @@ struct __is_constructible2_imp<false, _Ap[], _A0, _A1>
{};
#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif // __has_feature(is_constructible)
// is_default_constructible
OpenPOWER on IntegriCloud