aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorFrançois Dumont <fdumont@gcc.gnu.org>2013-11-22 20:55:53 +0000
committerFrançois Dumont <fdumont@gcc.gnu.org>2013-11-22 20:55:53 +0000
commit2e5189c83a2b2c6f3fff04f9d8f6c1b1a869b915 (patch)
tree0840632898ccd27c88a324a308ee5eb3f51ea60c /libstdc++-v3
parent79a8482c13b5892bdcd0f56bcae1a1b461a65997 (diff)
downloadgcc-2e5189c83a2b2c6f3fff04f9d8f6c1b1a869b915.zip
gcc-2e5189c83a2b2c6f3fff04f9d8f6c1b1a869b915.tar.gz
gcc-2e5189c83a2b2c6f3fff04f9d8f6c1b1a869b915.tar.bz2
safe_local_iterator.h (_Safe_local_iterator<>): Remove _M_bucket, use same information in normal local_iterator.
2013-11-22 François Dumont <fdumont@gcc.gnu.org> * include/debug/safe_local_iterator.h (_Safe_local_iterator<>): Remove _M_bucket, use same information in normal local_iterator. (operator==): Remove redundant _M_can_compare check. * include/debug/safe_local_iterator.tcc: Adapt. * include/debug/unordered_set: Likewise. * include/debug/unordered_map: Likewise. From-SVN: r205289
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog9
-rw-r--r--libstdc++-v3/include/debug/safe_local_iterator.h47
-rw-r--r--libstdc++-v3/include/debug/safe_local_iterator.tcc2
-rw-r--r--libstdc++-v3/include/debug/unordered_map24
-rw-r--r--libstdc++-v3/include/debug/unordered_set24
5 files changed, 53 insertions, 53 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 48e048c..ae34a28 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,12 @@
+2013-11-22 François Dumont <fdumont@gcc.gnu.org>
+
+ * include/debug/safe_local_iterator.h (_Safe_local_iterator<>):
+ Remove _M_bucket, use same information in normal local_iterator.
+ (operator==): Remove redundant _M_can_compare check.
+ * include/debug/safe_local_iterator.tcc: Adapt.
+ * include/debug/unordered_set: Likewise.
+ * include/debug/unordered_map: Likewise.
+
2013-11-22 Jakub Jelinek <jakub@redhat.com>
* testsuite/Makefile.am (check_DEJAGNU_normal_targets): Add 10.
diff --git a/libstdc++-v3/include/debug/safe_local_iterator.h b/libstdc++-v3/include/debug/safe_local_iterator.h
index 6724798..5b8d2ef 100644
--- a/libstdc++-v3/include/debug/safe_local_iterator.h
+++ b/libstdc++-v3/include/debug/safe_local_iterator.h
@@ -58,9 +58,6 @@ namespace __gnu_debug
/// The underlying iterator
_Iterator _M_current;
- /// The bucket this local iterator belongs to
- size_type _M_bucket;
-
/// Determine if this is a constant iterator.
bool
_M_constant() const
@@ -89,10 +86,8 @@ namespace __gnu_debug
* @pre @p seq is not NULL
* @post this is not singular
*/
- _Safe_local_iterator(const _Iterator& __i, size_type __bucket,
- const _Sequence* __seq)
- : _Safe_local_iterator_base(__seq, _M_constant()), _M_current(__i),
- _M_bucket(__bucket)
+ _Safe_local_iterator(const _Iterator& __i, const _Sequence* __seq)
+ : _Safe_local_iterator_base(__seq, _M_constant()), _M_current(__i)
{
_GLIBCXX_DEBUG_VERIFY(!this->_M_singular(),
_M_message(__msg_init_singular)
@@ -104,12 +99,12 @@ namespace __gnu_debug
*/
_Safe_local_iterator(const _Safe_local_iterator& __x)
: _Safe_local_iterator_base(__x, _M_constant()),
- _M_current(__x._M_current), _M_bucket(__x._M_bucket)
+ _M_current(__x._M_current)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 408. Is vector<reverse_iterator<char*> > forbidden?
_GLIBCXX_DEBUG_VERIFY(!__x._M_singular()
- || __x._M_current == _Iterator(),
+ || __x.base() == _Iterator(),
_M_message(__msg_init_copy_singular)
._M_iterator(*this, "this")
._M_iterator(__x, "other"));
@@ -127,7 +122,7 @@ namespace __gnu_debug
typename _Sequence::local_iterator::iterator_type>::__value,
_Sequence>::__type>& __x)
: _Safe_local_iterator_base(__x, _M_constant()),
- _M_current(__x.base()), _M_bucket(__x._M_bucket)
+ _M_current(__x.base())
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 408. Is vector<reverse_iterator<char*> > forbidden?
@@ -147,12 +142,11 @@ namespace __gnu_debug
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 408. Is vector<reverse_iterator<char*> > forbidden?
_GLIBCXX_DEBUG_VERIFY(!__x._M_singular()
- || __x._M_current == _Iterator(),
+ || __x.base() == _Iterator(),
_M_message(__msg_copy_singular)
._M_iterator(*this, "this")
._M_iterator(__x, "other"));
_M_current = __x._M_current;
- _M_bucket = __x._M_bucket;
this->_M_attach(__x._M_sequence);
return *this;
}
@@ -225,7 +219,7 @@ namespace __gnu_debug
* @brief Return the bucket
*/
size_type
- bucket() const { return _M_bucket; }
+ bucket() const { return _M_current._M_bucket; }
/**
* @brief Conversion to underlying non-debug iterator to allow
@@ -266,19 +260,20 @@ namespace __gnu_debug
_M_get_sequence() const
{ return static_cast<_Sequence*>(_M_sequence); }
- /// Is this iterator equal to the sequence's begin() iterator?
+ /// Is this iterator equal to the sequence's begin(bucket) iterator?
bool _M_is_begin() const
- { return base() == _M_get_sequence()->_M_base().begin(_M_bucket); }
+ { return base() == _M_get_sequence()->_M_base().begin(bucket()); }
- /// Is this iterator equal to the sequence's end() iterator?
+ /// Is this iterator equal to the sequence's end(bucket) iterator?
bool _M_is_end() const
- { return base() == _M_get_sequence()->_M_base().end(_M_bucket); }
+ { return base() == _M_get_sequence()->_M_base().end(bucket()); }
/// Is this iterator part of the same bucket as the other one?
- template <typename _Other>
- bool _M_in_same_bucket(const _Safe_local_iterator<_Other,
- _Sequence>& __other) const
- { return _M_bucket == __other.bucket(); }
+ template<typename _Other>
+ bool
+ _M_in_same_bucket(const _Safe_local_iterator<_Other,
+ _Sequence>& __other) const
+ { return bucket() == __other.bucket(); }
};
template<typename _IteratorL, typename _IteratorR, typename _Sequence>
@@ -286,7 +281,7 @@ namespace __gnu_debug
operator==(const _Safe_local_iterator<_IteratorL, _Sequence>& __lhs,
const _Safe_local_iterator<_IteratorR, _Sequence>& __rhs)
{
- _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _GLIBCXX_DEBUG_VERIFY(!__lhs._M_singular() && !__rhs._M_singular(),
_M_message(__msg_iter_compare_bad)
._M_iterator(__lhs, "lhs")
._M_iterator(__rhs, "rhs"));
@@ -294,10 +289,6 @@ namespace __gnu_debug
_M_message(__msg_compare_different)
._M_iterator(__lhs, "lhs")
._M_iterator(__rhs, "rhs"));
- _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
- _M_message(__msg_compare_different)
- ._M_iterator(__lhs, "lhs")
- ._M_iterator(__rhs, "rhs"));
_GLIBCXX_DEBUG_VERIFY(__lhs._M_in_same_bucket(__rhs),
_M_message(__msg_local_iter_compare_bad)
._M_iterator(__lhs, "lhs")
@@ -310,7 +301,7 @@ namespace __gnu_debug
operator==(const _Safe_local_iterator<_Iterator, _Sequence>& __lhs,
const _Safe_local_iterator<_Iterator, _Sequence>& __rhs)
{
- _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _GLIBCXX_DEBUG_VERIFY(!__lhs._M_singular() && !__rhs._M_singular(),
_M_message(__msg_iter_compare_bad)
._M_iterator(__lhs, "lhs")
._M_iterator(__rhs, "rhs"));
@@ -350,7 +341,7 @@ namespace __gnu_debug
operator!=(const _Safe_local_iterator<_Iterator, _Sequence>& __lhs,
const _Safe_local_iterator<_Iterator, _Sequence>& __rhs)
{
- _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _GLIBCXX_DEBUG_VERIFY(!__lhs._M_singular() && !__rhs._M_singular(),
_M_message(__msg_iter_compare_bad)
._M_iterator(__lhs, "lhs")
._M_iterator(__rhs, "rhs"));
diff --git a/libstdc++-v3/include/debug/safe_local_iterator.tcc b/libstdc++-v3/include/debug/safe_local_iterator.tcc
index 6633bdb..bef22fc 100644
--- a/libstdc++-v3/include/debug/safe_local_iterator.tcc
+++ b/libstdc++-v3/include/debug/safe_local_iterator.tcc
@@ -38,7 +38,7 @@ namespace __gnu_debug
{
if (!_M_can_compare(__rhs))
return false;
- if (_M_bucket != __rhs._M_bucket)
+ if (bucket() != __rhs.bucket())
return false;
/* Determine if we can order the iterators without the help of
diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map
index cbde903..c4be6ea 100644
--- a/libstdc++-v3/include/debug/unordered_map
+++ b/libstdc++-v3/include/debug/unordered_map
@@ -208,42 +208,42 @@ namespace __debug
begin(size_type __b)
{
__glibcxx_check_bucket_index(__b);
- return local_iterator(_Base::begin(__b), __b, this);
+ return local_iterator(_Base::begin(__b), this);
}
local_iterator
end(size_type __b)
{
__glibcxx_check_bucket_index(__b);
- return local_iterator(_Base::end(__b), __b, this);
+ return local_iterator(_Base::end(__b), this);
}
const_local_iterator
begin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
- return const_local_iterator(_Base::begin(__b), __b, this);
+ return const_local_iterator(_Base::begin(__b), this);
}
const_local_iterator
end(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
- return const_local_iterator(_Base::end(__b), __b, this);
+ return const_local_iterator(_Base::end(__b), this);
}
const_local_iterator
cbegin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
- return const_local_iterator(_Base::cbegin(__b), __b, this);
+ return const_local_iterator(_Base::cbegin(__b), this);
}
const_local_iterator
cend(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
- return const_local_iterator(_Base::cend(__b), __b, this);
+ return const_local_iterator(_Base::cend(__b), this);
}
size_type
@@ -664,42 +664,42 @@ namespace __debug
begin(size_type __b)
{
__glibcxx_check_bucket_index(__b);
- return local_iterator(_Base::begin(__b), __b, this);
+ return local_iterator(_Base::begin(__b), this);
}
local_iterator
end(size_type __b)
{
__glibcxx_check_bucket_index(__b);
- return local_iterator(_Base::end(__b), __b, this);
+ return local_iterator(_Base::end(__b), this);
}
const_local_iterator
begin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
- return const_local_iterator(_Base::begin(__b), __b, this);
+ return const_local_iterator(_Base::begin(__b), this);
}
const_local_iterator
end(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
- return const_local_iterator(_Base::end(__b), __b, this);
+ return const_local_iterator(_Base::end(__b), this);
}
const_local_iterator
cbegin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
- return const_local_iterator(_Base::cbegin(__b), __b, this);
+ return const_local_iterator(_Base::cbegin(__b), this);
}
const_local_iterator
cend(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
- return const_local_iterator(_Base::cend(__b), __b, this);
+ return const_local_iterator(_Base::cend(__b), this);
}
size_type
diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set
index 66898e2..4923be8 100644
--- a/libstdc++-v3/include/debug/unordered_set
+++ b/libstdc++-v3/include/debug/unordered_set
@@ -207,42 +207,42 @@ namespace __debug
begin(size_type __b)
{
__glibcxx_check_bucket_index(__b);
- return local_iterator(_Base::begin(__b), __b, this);
+ return local_iterator(_Base::begin(__b), this);
}
local_iterator
end(size_type __b)
{
__glibcxx_check_bucket_index(__b);
- return local_iterator(_Base::end(__b), __b, this);
+ return local_iterator(_Base::end(__b), this);
}
const_local_iterator
begin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
- return const_local_iterator(_Base::begin(__b), __b, this);
+ return const_local_iterator(_Base::begin(__b), this);
}
const_local_iterator
end(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
- return const_local_iterator(_Base::end(__b), __b, this);
+ return const_local_iterator(_Base::end(__b), this);
}
const_local_iterator
cbegin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
- return const_local_iterator(_Base::cbegin(__b), __b, this);
+ return const_local_iterator(_Base::cbegin(__b), this);
}
const_local_iterator
cend(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
- return const_local_iterator(_Base::cend(__b), __b, this);
+ return const_local_iterator(_Base::cend(__b), this);
}
size_type
@@ -658,42 +658,42 @@ namespace __debug
begin(size_type __b)
{
__glibcxx_check_bucket_index(__b);
- return local_iterator(_Base::begin(__b), __b, this);
+ return local_iterator(_Base::begin(__b), this);
}
local_iterator
end(size_type __b)
{
__glibcxx_check_bucket_index(__b);
- return local_iterator(_Base::end(__b), __b, this);
+ return local_iterator(_Base::end(__b), this);
}
const_local_iterator
begin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
- return const_local_iterator(_Base::begin(__b), __b, this);
+ return const_local_iterator(_Base::begin(__b), this);
}
const_local_iterator
end(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
- return const_local_iterator(_Base::end(__b), __b, this);
+ return const_local_iterator(_Base::end(__b), this);
}
const_local_iterator
cbegin(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
- return const_local_iterator(_Base::cbegin(__b), __b, this);
+ return const_local_iterator(_Base::cbegin(__b), this);
}
const_local_iterator
cend(size_type __b) const
{
__glibcxx_check_bucket_index(__b);
- return const_local_iterator(_Base::cend(__b), __b, this);
+ return const_local_iterator(_Base::cend(__b), this);
}
size_type