Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2004-09-15 14:56:43


From: "Thorsten Ottosen" <nesotto_at_[hidden]>
>
> In the pre-redmond mailing Walter Brown discusses the possibility of adding
> these members to standard container classes:
>
> const_iterator cbegin();
> const_iterator cend();
> const_reverse_iterator crbegin();
> const_reverse_iterator crbegin();
>
> The motiviation is that we want to be able to say explicitly "give me a const
> iterator" without doing ugly casts.
> IMO a sound idea.

Agreed.

> Given the framework in boost.range these would be absolutely *trivial* to add.
>
> 1st vote: for or against adding these?

Yes.

> 2nd vote: which naming scheme to use:
>
> a: cbegin(), cr_begin()
>
> b: const_begin(); const_rbegin();

Unquestionably, "b." That version parallels "iterator" versus
"const_iterator," not to mention being more readable.

-- 
Rob Stewart                           stewart_at_[hidden]
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk