Boost logo

Boost :

Subject: Re: [boost] [flat_set] When to sort?
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2017-04-08 10:48:30


On 08/04/2017 9:34, Marc Glisse via Boost wrote:

> That seems more complicated than simply giving (in-place) access to the
> internal sequence_type. You already had to document the invariants for
> adopt_sequence(ordered_unique_range_t,*) and more or less promised that
> extract_sequence takes constant time, so the abstraction doesn't buy you
> much.

adopt/extract maintain class invariants which can avoid a lot of
headaches. Even adopt_sequence(ordered[_unique[_range_t, ...) checks
preconditions (ordered [and unique]) in debug mode.

Could you please elaborate what does "giving access to the internal
sequence_type" mean? Something like:

class flat_xxx
{
    sequence_type &sequence_ref()
    { return m_seq; }
};

?

I'm open to improvements/new functions ;-)

Ion


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