summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-25 12:07:55 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-25 12:07:55 +0000
commitd9492fde0feb1ab405d4221ba25ec1e5e35fc38e (patch)
treeb6a98ac0c2f374d16f8be381965ebed1efbf7dfe
parent3dc6c978d958b70263fd6ddc2307b998364e3a2b (diff)
downloadgcc-d9492fde0feb1ab405d4221ba25ec1e5e35fc38e.tar.gz
2007-11-25 Paolo Carlini <pcarlini@suse.de>
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130405 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libstdc++-v3/ChangeLog8
-rw-r--r--libstdc++-v3/docs/html/17_intro/c++0x_status.html2
-rw-r--r--libstdc++-v3/include/tr1_impl/array23
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,5 +1,13 @@
2007-11-25 Paolo Carlini <pcarlini@suse.de>
+ * 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 <pcarlini@suse.de>
+
* include/bits/stl_algobase.h (__lexicographical_compare<>::__lc):
Move out of line.
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.
<tr>
<td>23.2.1.4</td>
<td><code>array </code>data</td>
+ <td>done</td>
<td></td>
<td></td>
- <td>missing</td>
<td></td>
</tr>
<tr>
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<std::size_t _Mm>
- 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<std::size_t _Mm>
- typename __gnu_cxx::__enable_if<!_Mm, void>::__type
- _M_check(size_type) const
- { std::__throw_out_of_range(__N("array::_M_check")); }
};
// Array comparisons.