Boost logo

Boost Users :

Subject: Re: [Boost-users] container with large number of elements and a small number of invalide elements
From: Jeff Flinn (Jeffrey.Flinn_at_[hidden])
Date: 2013-11-01 08:37:09


On 10/31/2013 1:14 PM, MM wrote:
> On 31 October 2013 16:10, Klaim - Joël Lamotte <mjklaim_at_[hidden]
> <mailto: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,

So why not keep the invalid items from getting into the container in the
first place?

Jeff


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