diff options
Diffstat (limited to 'gcc-4.9/libstdc++-v3/include/debug')
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/debug/array | 32 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/include/debug/functions.h | 14 |
2 files changed, 27 insertions, 19 deletions
diff --git a/gcc-4.9/libstdc++-v3/include/debug/array b/gcc-4.9/libstdc++-v3/include/debug/array index ef01c981b..cd3eb0a20 100644 --- a/gcc-4.9/libstdc++-v3/include/debug/array +++ b/gcc-4.9/libstdc++-v3/include/debug/array @@ -150,15 +150,15 @@ namespace __debug operator[](size_type __n) noexcept { __glibcxx_check_subscript(__n); - return _AT_Type::_S_ref(_M_elems, __n); + return *_AT_Type::_S_ptr(_M_elems, __n); } constexpr const_reference operator[](size_type __n) const noexcept { - return __n < _Nm ? _AT_Type::_S_ref(_M_elems, __n) + return __n < _Nm ? *_AT_Type::_S_ptr(_M_elems, __n) : (_GLIBCXX_THROW_OR_ABORT(_Array_check_subscript<_Nm>(__n)), - _AT_Type::_S_ref(_M_elems, 0)); + *_AT_Type::_S_ptr(_M_elems, 0)); } reference @@ -169,7 +169,7 @@ namespace __debug "(which is %zu) >= _Nm " "(which is %zu)"), __n, _Nm); - return _AT_Type::_S_ref(_M_elems, __n); + return *_AT_Type::_S_ptr(_M_elems, __n); } constexpr const_reference @@ -177,11 +177,11 @@ namespace __debug { // Result of conditional expression must be an lvalue so use // boolean ? lvalue : (throw-expr, lvalue) - return __n < _Nm ? _AT_Type::_S_ref(_M_elems, __n) + return __n < _Nm ? *_AT_Type::_S_ptr(_M_elems, __n) : (std::__throw_out_of_range_fmt(__N("array::at: __n (which is %zu) " ">= _Nm (which is %zu)"), __n, _Nm), - _AT_Type::_S_ref(_M_elems, 0)); + *_AT_Type::_S_ptr(_M_elems, 0)); } reference @@ -194,9 +194,9 @@ namespace __debug constexpr const_reference front() const noexcept { - return _Nm ? _AT_Type::_S_ref(_M_elems, 0) + return _Nm ? *_AT_Type::_S_ptr(_M_elems, 0) : (_GLIBCXX_THROW_OR_ABORT(_Array_check_nonempty<_Nm>()), - _AT_Type::_S_ref(_M_elems, 0)); + *_AT_Type::_S_ptr(_M_elems, 0)); } reference @@ -209,18 +209,18 @@ namespace __debug constexpr const_reference back() const noexcept { - return _Nm ? _AT_Type::_S_ref(_M_elems, _Nm - 1) + return _Nm ? *_AT_Type::_S_ptr(_M_elems, _Nm - 1) : (_GLIBCXX_THROW_OR_ABORT(_Array_check_nonempty<_Nm>()), - _AT_Type::_S_ref(_M_elems, 0)); + *_AT_Type::_S_ptr(_M_elems, 0)); } pointer data() noexcept - { return std::__addressof(_AT_Type::_S_ref(_M_elems, 0)); } + { return _AT_Type::_S_ptr(_M_elems, 0); } const_pointer data() const noexcept - { return std::__addressof(_AT_Type::_S_ref(_M_elems, 0)); } + { return _AT_Type::_S_ptrr(_M_elems, 0); } }; // Array comparisons. @@ -269,8 +269,8 @@ namespace __debug get(array<_Tp, _Nm>& __arr) noexcept { static_assert(_Int < _Nm, "index is out of bounds"); - return _GLIBCXX_STD_C::__array_traits<_Tp, _Nm>:: - _S_ref(__arr._M_elems, _Int); + return *_GLIBCXX_STD_C::__array_traits<_Tp, _Nm>:: + _S_ptr(__arr._M_elems, _Int); } template<std::size_t _Int, typename _Tp, std::size_t _Nm> @@ -286,8 +286,8 @@ namespace __debug get(const array<_Tp, _Nm>& __arr) noexcept { static_assert(_Int < _Nm, "index is out of bounds"); - return _GLIBCXX_STD_C::__array_traits<_Tp, _Nm>:: - _S_ref(__arr._M_elems, _Int); + return *_GLIBCXX_STD_C::__array_traits<_Tp, _Nm>:: + _S_ptr(__arr._M_elems, _Int); } } // namespace __debug diff --git a/gcc-4.9/libstdc++-v3/include/debug/functions.h b/gcc-4.9/libstdc++-v3/include/debug/functions.h index b48c36d4a..0e7f1b785 100644 --- a/gcc-4.9/libstdc++-v3/include/debug/functions.h +++ b/gcc-4.9/libstdc++-v3/include/debug/functions.h @@ -34,7 +34,7 @@ // _Iter_base #include <bits/cpp_type_traits.h> // for __is_integer #include <bits/move.h> // for __addressof and addressof -# include <bits/stl_function.h> // for less +#include <bits/stl_function.h> // for less #if __cplusplus >= 201103L # include <type_traits> // for is_lvalue_reference and __and_ #endif @@ -252,8 +252,16 @@ namespace __gnu_debug const _InputIterator& __other, const _InputIterator& __other_end) { - return __foreign_iterator_aux3(__it, __other, __other_end, - _Is_contiguous_sequence<_Sequence>()); +#if __cplusplus < 201103L + typedef _Is_contiguous_sequence<_Sequence> __tag; +#else + using __lvalref = std::is_lvalue_reference< + typename std::iterator_traits<_InputIterator>::reference>; + using __contiguous = _Is_contiguous_sequence<_Sequence>; + using __tag = typename std::conditional<__lvalref::value, __contiguous, + std::__false_type>::type; +#endif + return __foreign_iterator_aux3(__it, __other, __other_end, __tag()); } /* Handle the case where we aren't really inserting a range after all */ |