diff options
Diffstat (limited to 'gcc-4.9/libstdc++-v3/include/std/array')
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/std/array | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc-4.9/libstdc++-v3/include/std/array b/gcc-4.9/libstdc++-v3/include/std/array index b7abeb09b..58557901a 100644 --- a/gcc-4.9/libstdc++-v3/include/std/array +++ b/gcc-4.9/libstdc++-v3/include/std/array @@ -50,7 +50,18 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER static constexpr _Tp* _S_ptr(const _Type& __t, std::size_t __n) noexcept +#if __google_stl_debug_array + { + return __n < _Nm + ? const_cast<_Tp*>(std::__addressof(__t[__n])) + : (std::__throw_out_of_range_fmt(__N("array::_S_ptr: __n " + "(which is %zu) >= size() " + "(which is %zu)"), + __n, _Nm), nullptr); + } +#else { return const_cast<_Tp*>(std::__addressof(__t[__n])); } +#endif }; template<typename _Tp> |