|
Boost : |
Subject: Re: [boost] [constrained] constrained_vector
From: Neal Becker (ndbecker2_at_[hidden])
Date: 2008-12-23 09:20:38
Gordon Woodhull wrote:
>
> On Dec 22, 2008, at 1:47 PM, Neal Becker wrote:
>
>> 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.
>
> Not as general, but possible right now: use bounded with the bounds as
> static members. This gives you as many classes of constraints as you
> care to spell out. Example follows.
>
Interesting example. IIUC, though, what I need is run-time bounds and the example is compile-time.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk