summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/include/__tuple
diff options
context:
space:
mode:
authortheraven <theraven@FreeBSD.org>2012-05-03 17:44:07 +0000
committertheraven <theraven@FreeBSD.org>2012-05-03 17:44:07 +0000
commit011d8001e295ab428f3d73602d2e4fa0b248efc4 (patch)
treea0abba0a80f7ff64ba1a78df7fd8544414370f33 /contrib/libc++/include/__tuple
parent72d6cdcd97718bf58e38b0484a01bf5c6de14bc4 (diff)
downloadFreeBSD-src-011d8001e295ab428f3d73602d2e4fa0b248efc4.zip
FreeBSD-src-011d8001e295ab428f3d73602d2e4fa0b248efc4.tar.gz
Import new version of libc++. Among other improvements, this comes with an
<atomic> header that works with clang 3.1 (and, importantly, the pre-3.1 snapshot currently in head)
Diffstat (limited to 'contrib/libc++/include/__tuple')
-rw-r--r--contrib/libc++/include/__tuple29
1 files changed, 28 insertions, 1 deletions
diff --git a/contrib/libc++/include/__tuple b/contrib/libc++/include/__tuple
index 3b2be1c..8216804 100644
--- a/contrib/libc++/include/__tuple
+++ b/contrib/libc++/include/__tuple
@@ -216,7 +216,7 @@ struct __tuple_convertible_imp : public false_type {};
template <class _Tp0, class ..._Tp, class _Up0, class ..._Up>
struct __tuple_convertible_imp<true, __tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
: public integral_constant<bool,
- is_constructible<_Up0, _Tp0>::value &&
+ is_convertible<_Tp0, _Up0>::value &&
__tuple_convertible_imp<true, __tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};
template <>
@@ -235,6 +235,33 @@ struct __tuple_convertible<_Tp, _Up, true, true>
typename __make_tuple_types<_Tp>::type, typename __make_tuple_types<_Up>::type>
{};
+// __tuple_constructible
+
+template <bool, class _Tp, class _Up>
+struct __tuple_constructible_imp : public false_type {};
+
+template <class _Tp0, class ..._Tp, class _Up0, class ..._Up>
+struct __tuple_constructible_imp<true, __tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
+ : public integral_constant<bool,
+ is_constructible<_Up0, _Tp0>::value &&
+ __tuple_constructible_imp<true, __tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};
+
+template <>
+struct __tuple_constructible_imp<true, __tuple_types<>, __tuple_types<> >
+ : public true_type {};
+
+template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
+ bool = __tuple_like<_Up>::value>
+struct __tuple_constructible
+ : public false_type {};
+
+template <class _Tp, class _Up>
+struct __tuple_constructible<_Tp, _Up, true, true>
+ : public __tuple_constructible_imp<tuple_size<typename remove_reference<_Tp>::type>::value ==
+ tuple_size<_Up>::value,
+ typename __make_tuple_types<_Tp>::type, typename __make_tuple_types<_Up>::type>
+{};
+
// __tuple_assignable
template <bool, class _Tp, class _Up>
OpenPOWER on IntegriCloud