summaryrefslogtreecommitdiff
path: root/include/array
diff options
context:
space:
mode:
authorDavid Chisnall <theraven@FreeBSD.org>2013-02-07 13:09:19 +0000
committerDavid Chisnall <theraven@FreeBSD.org>2013-02-07 13:09:19 +0000
commitc7f918d0681828afdbddfdcc354b6f3dfc2a7b68 (patch)
treed1f057460d329356b56f67bf5740b7393c925844 /include/array
parentfbd326037ffe8b31f74ce56deb05b6432b26665c (diff)
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 029bfd00a5c00..f4a3020aeae72 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]);
}