From 1cbb7f6e578035cf4b274624c7c40e2e23d9f766 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 17 Apr 2006 11:06:08 +0000 Subject: [PATCH] Re-introduce the non const overloads of begin and end for unordered_set and unordered_multiset. I thought the proposed resolution for issue 528 allowed them to be removed, but re-reading it, it only allows signatures that are 'otherwise indistinguishable', and they are not. [SVN r2923] --- include/boost/unordered_set.hpp | 43 ++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/include/boost/unordered_set.hpp b/include/boost/unordered_set.hpp index ed5e08a4..0db03dba 100644 --- a/include/boost/unordered_set.hpp +++ b/include/boost/unordered_set.hpp @@ -129,11 +129,21 @@ namespace boost // iterators + iterator begin() + { + return iterator(base.begin()); + } + const_iterator begin() const { return const_iterator(base.begin()); } + iterator end() + { + return iterator(base.end()); + } + const_iterator end() const { return const_iterator(base.end()); @@ -236,16 +246,27 @@ namespace boost return base.bucket(k); } - const_local_iterator begin(size_type n) const + local_iterator begin(size_type n) { return local_iterator(base.begin(n)); } + const_local_iterator begin(size_type n) const + { + return const_local_iterator(base.begin(n)); + } + + local_iterator end(size_type n) + { + return local_iterator(base.end(n)); + } + const_local_iterator end(size_type n) const { return const_local_iterator(base.end(n)); } + // hash policy float load_factor() const @@ -377,11 +398,21 @@ namespace boost // iterators + iterator begin() + { + return iterator(base.begin()); + } + const_iterator begin() const { return const_iterator(base.begin()); } + iterator end() + { + return iterator(base.end()); + } + const_iterator end() const { return const_iterator(base.end()); @@ -483,11 +514,21 @@ namespace boost return base.bucket(k); } + local_iterator begin(size_type n) + { + return local_iterator(base.begin(n)); + } + const_local_iterator begin(size_type n) const { return const_local_iterator(base.begin(n)); } + local_iterator end(size_type n) + { + return local_iterator(base.end(n)); + } + const_local_iterator end(size_type n) const { return const_local_iterator(base.end(n));