summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/include/array
diff options
context:
space:
mode:
authortheraven <theraven@FreeBSD.org>2013-02-07 15:45:28 +0000
committertheraven <theraven@FreeBSD.org>2013-02-07 15:45:28 +0000
commitd19c702291ff3bd9e769a152e7db96e17f5167f7 (patch)
tree52637438fa031aa783147d9ac30dac90131dffdf /contrib/libc++/include/array
parent0ab90cb3f6b7aa6a5a725c5aadaee31d34eaca96 (diff)
downloadFreeBSD-src-d19c702291ff3bd9e769a152e7db96e17f5167f7.zip
FreeBSD-src-d19c702291ff3bd9e769a152e7db96e17f5167f7.tar.gz
Import new libc++ to head. Various small fixes and cleanups.
MFC after: 2 weeks
Diffstat (limited to 'contrib/libc++/include/array')
-rw-r--r--contrib/libc++/include/array3
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/libc++/include/array b/contrib/libc++/include/array
index 029bfd0..f4a3020 100644
--- a/contrib/libc++/include/array
+++ b/contrib/libc++/include/array
@@ -310,6 +310,7 @@ _LIBCPP_INLINE_VISIBILITY inline
_Tp&
get(array<_Tp, _Size>& __a) _NOEXCEPT
{
+ static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::array)");
return __a[_Ip];
}
@@ -318,6 +319,7 @@ _LIBCPP_INLINE_VISIBILITY inline
const _Tp&
get(const array<_Tp, _Size>& __a) _NOEXCEPT
{
+ static_assert(_Ip < _Size, "Index out of bounds in std::get<> (const std::array)");
return __a[_Ip];
}
@@ -328,6 +330,7 @@ _LIBCPP_INLINE_VISIBILITY inline
_Tp&&
get(array<_Tp, _Size>&& __a) _NOEXCEPT
{
+ static_assert(_Ip < _Size, "Index out of bounds in std::get<> (std::array &&)");
return _VSTD::move(__a[_Ip]);
}
OpenPOWER on IntegriCloud