Boost logo

Boost :

Subject: Re: [boost] [Container] small flat set ?
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2017-09-06 01:58:06


On 5/09/2017 16:25, degski wrote:
> On 4 September 2017 at 18:12, Phil Endecott wrote:
>>
>> But that gets complicated if you need iterators with the normal behaviour.
>
> Wrap a std::vector or a std::array (if fixed size) and forward the begin()
> and end() iterators of the container. This then will also give you range
> based for loops (for free) on your type.

That produces iterators with vector behaviour (invalidated on any
modification) rather than set behaviour (invalidated only if that
element is deleted), which can be a significant behavioural change.


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