Unordered: Return iterators in pairs instead of node_pointers.

It looks like the current version doesn't work with a correct
implementation of C++11 pairs since they don't use explicit conversions.
So just return the correct type in the first place.

Should probably be using iterators in other places as well. I was using
node_pointers everywhere due to some legacy from older versions.

[SVN r75158]
This commit is contained in:
Daniel James committed 2011-10-28 17:42:51 +00:00
1 parent 6ebc2e72ff
commit a5dcc9dab0
2 files changed
+17 -13

No files matched your search

@@ -178,6 +178,7 @@ namespace boost { namespace unordered { namespace detail {
typedef typename table::key_type key_type;
typedef typename table::node_constructor node_constructor;
typedef typename table::extractor extractor;
typedef typename table::iterator iterator;
// Constructors
@@ -255,13 +256,15 @@ namespace boost { namespace unordered { namespace detail {
return count;
}
std::pair<node_pointer, node_pointer>
std::pair<iterator, iterator>
equal_range(key_type const& k) const
{
node_pointer n = this->find_node(k);
return std::make_pair(n,
n ? static_cast<node_pointer>(
static_cast<node_pointer>(n->group_prev_)->next_) : n);
return std::make_pair(
iterator(n), iterator(n ?
static_cast<node_pointer>(
static_cast<node_pointer>(n->group_prev_)->next_) :
n));
}
// Equality