From 64f6a0efdfa5c03132c45952bd1986a8adc2c19d Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Sun, 25 Nov 2007 12:07:55 +0000 Subject: [PATCH] array (array<>::_M_check): Remove, not necessary anymore. 2007-11-25 Paolo Carlini * include/tr1_impl/array (array<>::_M_check): Remove, not necessary anymore. (array<>::at): Adjust. * docs/html/17_intro/c++0x_status.html: Fix array::data entry. From-SVN: r130405 --- libstdc++-v3/ChangeLog | 8 +++++++ .../docs/html/17_intro/c++0x_status.html | 2 +- libstdc++-v3/include/tr1_impl/array | 23 ++++--------------- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 91aba14ac37..0688b26524a 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2007-11-25 Paolo Carlini + + * include/tr1_impl/array (array<>::_M_check): Remove, not necessary + anymore. + (array<>::at): Adjust. + + * docs/html/17_intro/c++0x_status.html: Fix array::data entry. + 2007-11-25 Paolo Carlini * include/bits/stl_algobase.h (__lexicographical_compare<>::__lc): diff --git a/libstdc++-v3/docs/html/17_intro/c++0x_status.html b/libstdc++-v3/docs/html/17_intro/c++0x_status.html index 5627d6fe178..e4e07e01f3b 100644 --- a/libstdc++-v3/docs/html/17_intro/c++0x_status.html +++ b/libstdc++-v3/docs/html/17_intro/c++0x_status.html @@ -771,9 +771,9 @@ particular release. 23.2.1.4 array data + done - missing diff --git a/libstdc++-v3/include/tr1_impl/array b/libstdc++-v3/include/tr1_impl/array index 425b87cffbb..7a13ba8ff8d 100644 --- a/libstdc++-v3/include/tr1_impl/array +++ b/libstdc++-v3/include/tr1_impl/array @@ -136,15 +136,17 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 reference at(size_type __n) - { - _M_check<_Nm>(__n); + { + if (__builtin_expect(__n >= _Nm, false)) + std::__throw_out_of_range(__N("array::at")); return _M_instance[__n]; } const_reference at(size_type __n) const { - _M_check<_Nm>(__n); + if (__builtin_expect(__n >= _Nm, false)) + std::__throw_out_of_range(__N("array::at")); return _M_instance[__n]; } @@ -171,21 +173,6 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 const _Tp* data() const { return &_M_instance[0]; } - - private: - template - typename __gnu_cxx::__enable_if<_Mm, void>::__type - _M_check(size_type __n) const - { - if (__builtin_expect(__n >= _Mm, false)) - std::__throw_out_of_range(__N("array::_M_check")); - } - - // Avoid "unsigned comparison with zero" warnings. - template - typename __gnu_cxx::__enable_if::__type - _M_check(size_type) const - { std::__throw_out_of_range(__N("array::_M_check")); } }; // Array comparisons.