Boost logo

Boost Users :

Subject: Re: [Boost-users] container with large number of elements and a small number of invalide elements
From: MM (finjulhich_at_[hidden])
Date: 2013-10-31 13:14:45


On 31 October 2013 16:10, Klaim - Joël Lamotte <mjklaim_at_[hidden]> wrote:

> What would "valid"/"invalid" means here?
> If it's "exist" or "don't exist", then maybe using boost::optional<MyPod>
> would be enough.
>

That's right. How about sizeof( boost::optional<MyPod> ) vs sizeof( MyPOD
) ?
Also, what sort of iterator can iterate over just the valid values? or how
to implement one?
The point here is that there's a small number of elements that are invalid,
their indices in the container are random,



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