Boost logo

Boost :

Subject: Re: [boost] Query regarding time complexity requirements of iterators in custom container
From: Rob Stewart (rob.stewart_at_[hidden])
Date: 2016-01-23 07:23:55


On January 22, 2016 4:50:56 PM EST, Soul Studios <matt_at_[hidden]> wrote:
>
> Ion pointed out to me that there is an obscure C++ requirement for
> iterators that all operations be constant-time.
> Given this, is it worth keeping these in Colony before submitting to
> Boost, or would it be best to remove them and make the iterator
> bidirectional-only prior?

I don't know anything about Colony, but violating requirements for iterators would not be a good idea. However, if you provide a non-standard means to access the iterators, you could give users the choice to gain random access while not accidentally using the non-conforming random access iterators in normal contexts. IOW, don't use begin() and end(), but some variant thereof.

___
Rob

(Sent from my portable computation engine)


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