Add cbegin() and cend() from the new draft standard to the unordered containers.

The standard doesn't add them for local iterators, but I'm guessing that's an
oversight. So for now, I've hidden them behind a preprocessor condition. Which
I'll probably remove before review.


[SVN r2944]
This commit is contained in:
Daniel James
2006-04-30 14:11:47 +00:00
parent ed6df529e4
commit 0fcb2d8041
2 changed files with 87 additions and 0 deletions

View File

@ -172,6 +172,16 @@ namespace boost
return const_iterator(base.end());
}
const_iterator cbegin() const
{
return const_iterator(base.begin());
}
const_iterator cend() const
{
return const_iterator(base.end());
}
// modifiers
std::pair<iterator, bool> insert(const value_type& obj)
@ -321,6 +331,18 @@ namespace boost
return const_local_iterator(base.end(n));
}
#if defined(BOOST_UNORDERED_LOCAL_CBEGIN)
const_local_iterator cbegin(size_type n) const
{
return const_local_iterator(base.begin(n));
}
const_local_iterator cend(size_type n) const
{
return const_local_iterator(base.end(n));
}
#endif
// hash policy
float load_factor() const
@ -475,6 +497,16 @@ namespace boost
return const_iterator(base.end());
}
const_iterator cbegin() const
{
return const_iterator(base.begin());
}
const_iterator cend() const
{
return const_iterator(base.end());
}
// modifiers
iterator insert(const value_type& obj)
@ -618,6 +650,18 @@ namespace boost
return const_local_iterator(base.end(n));
}
#if defined(BOOST_UNORDERED_LOCAL_CBEGIN)
const_local_iterator cbegin(size_type n) const
{
return const_local_iterator(base.begin(n));
}
const_local_iterator cend(size_type n) const
{
return const_local_iterator(base.end(n));
}
#endif
// hash policy
float load_factor() const