summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/include/memory
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/memory
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/memory')
-rw-r--r--contrib/libc++/include/memory60
1 files changed, 18 insertions, 42 deletions
diff --git a/contrib/libc++/include/memory b/contrib/libc++/include/memory
index aa24f96..e30a6fd 100644
--- a/contrib/libc++/include/memory
+++ b/contrib/libc++/include/memory
@@ -1685,39 +1685,21 @@ public:
::new((void*)__p) _Tp();
}
# if defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
+
template <class _A0>
_LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- !is_convertible<_A0, __rv<_A0> >::value,
- void
- >::type
+ void
construct(pointer __p, _A0& __a0)
{
::new((void*)__p) _Tp(__a0);
}
template <class _A0>
_LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- !is_convertible<_A0, __rv<_A0> >::value,
- void
- >::type
+ void
construct(pointer __p, const _A0& __a0)
{
::new((void*)__p) _Tp(__a0);
}
- template <class _A0>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- is_convertible<_A0, __rv<_A0> >::value,
- void
- >::type
- construct(pointer __p, _A0 __a0)
- {
- ::new((void*)__p) _Tp(_VSTD::move(__a0));
- }
# endif // defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
template <class _A0, class _A1>
_LIBCPP_INLINE_VISIBILITY
@@ -1793,39 +1775,21 @@ public:
::new((void*)__p) _Tp();
}
# if defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
+
template <class _A0>
_LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- !is_convertible<_A0, __rv<_A0> >::value,
- void
- >::type
+ void
construct(pointer __p, _A0& __a0)
{
::new((void*)__p) _Tp(__a0);
}
template <class _A0>
_LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- !is_convertible<_A0, __rv<_A0> >::value,
- void
- >::type
+ void
construct(pointer __p, const _A0& __a0)
{
::new((void*)__p) _Tp(__a0);
}
- template <class _A0>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- is_convertible<_A0, __rv<_A0> >::value,
- void
- >::type
- construct(pointer __p, _A0 __a0)
- {
- ::new((void*)__p) _Tp(_VSTD::move(__a0));
- }
# endif // defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
template <class _A0, class _A1>
_LIBCPP_INLINE_VISIBILITY
@@ -3086,6 +3050,18 @@ operator>=(nullptr_t, const unique_ptr<_T1, _D1>& __x)
return !(nullptr < __x);
}
+#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+template <class _Tp, class _Dp>
+inline _LIBCPP_INLINE_VISIBILITY
+unique_ptr<_Tp, _Dp>
+move(unique_ptr<_Tp, _Dp>& __t)
+{
+ return unique_ptr<_Tp, _Dp>(__rv<unique_ptr<_Tp, _Dp> >(__t));
+}
+
+#endif
+
template <class _Tp> struct hash;
// We use murmur2 when size_t is 32 bits, and cityhash64 when size_t
OpenPOWER on IntegriCloud