Boost logo

Boost :

Subject: Re: [boost] [constrained] constrained_vector
From: Robert Kawulak (robert.kawulak_at_[hidden])
Date: 2009-02-08 23:12:22


Hi,

> From: Neal Becker
>
> I'm interested in something like constrained, but applied to a vector of
> values. The case I'm interested in is a homogeneous vector of bounded int
> values, with bounds set at runtime.
>
> It is trivial to have a vector<bounded<int> >, but this would not be space
> efficient in the case where the policies, bounds on all the values are the
> same.

Maybe you could use the policy described here:
http://lists.boost.org/boost-users/2008/12/42959.php
It will let you set the bounds at runtime, but not change them once any object
using this policy is created. However, it will have no space overhead on the
individual objects.

Regards,
Robert


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