summaryrefslogtreecommitdiffstats
path: root/include/array
diff options
context:
space:
mode:
authortheraven <theraven@FreeBSD.org>2013-02-07 13:09:19 +0000
committertheraven <theraven@FreeBSD.org>2013-02-07 13:09:19 +0000
commitfab14d3df75fc3af83c06ed85bb9c068f1144351 (patch)
treed1f057460d329356b56f67bf5740b7393c925844 /include/array
parent3deb12eac5b63fcfb8306b76b41032a9083ae563 (diff)
downloadFreeBSD-src-fab14d3df75fc3af83c06ed85bb9c068f1144351.zip
FreeBSD-src-fab14d3df75fc3af83c06ed85bb9c068f1144351.tar.gz
Import new libc++ to vendor branch.
Diffstat (limited to 'include/array')
-rw-r--r--include/array3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/array b/include/array
index 029bfd0..f4a3020 100644
--- a/include/array
+++ b/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