Boost logo

Boost Users :

From: Daniel James (daniel_james_at_[hidden])
Date: 2007-12-16 04:53:49


On 15/12/2007, Cromwell Enage <sponage_at_[hidden]> wrote:
>
> The implementation rationale is detailed enough;
> however, I am curious as to the purpose of
> BOOST_UNORDERED_LOCAL_CBEGIN.

To be honest, it's something I'd forgotten about. A while ago, the
'cbegin' and 'cend' members were added to all the standard containers
in the draft standard for accessing 'const_iterator' regardless of
whether the container is const or not. But they weren't added for the
unordered containers' local iterators (the iterators for single
buckets). If that macro is defined they are included in the
implementation.

I think the best thing to do is include the methods as an extension
and document and test them properly. I might add a macro to turn off
extensions.

Joaquín asked about this on comp.std.c++ but didn't get any reply:

http://groups.google.com/group/comp.std.c++/browse_thread/thread/ee50866120702ed6/407687119d0e131c

> > * What is your evaluation of the documentation?
>
> It's pretty thorough. A few nits and issues:

Thanks for these, I'll try to fix all of them. Just one point:

> * Sometimes I see "T" where "Value" was meant to be.
> This appears in the reference documentation for all
> containers.

In unordered_set/unordered_multiset it's only in the swap functions,
and they're incorrect. (I think I copied and pasted them from the map
documentation).

In unordered_map/unordered_multimap, the use of 'T' is deliberate, as
'Value' should be the same as the value_type typedef, but value_type
is defined as std::pair<Key const, T>. 'T' is what the standard uses
but I think I'll replace it with 'Mapped' which is hopefully more
descriptive.

Thanks for the review,

Daniel


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net