
Boost : 
Subject: Re: [boost] [constrained_value] Constrained Value review results
From: Robert Kawulak (robert.kawulak_at_[hidden])
Date: 20101008 12:10:01
2010/10/8 Stewart, Robert <Robert.Stewart_at_[hidden]>:
>> You mean "bound" as past participle of "to bind", so "ct_bound" would
>> mean something that has been bound (i.e., "binded") at compile time? I
>> think the operation we want to express is bounding rather than
>> binding...
>
> I see the bounds as being applied at compile time, so it is bound to the specified range at compile time, so, yes, I meant the past participle of the infinitive "to bind." That the bounds continue to apply at runtime after having been bound at compile time is not, I think, the principle distinction.
But applying fixed bounds at compile time is not a defining
characteristic of "bounded_int", it is using compile time constant
expressions to specify the bounds.
>> > ct_bounded<int>
>> > rt_bounded<short>
>>
>> The former is the subset of the latter, so "rt_bounded" is not a good
>> idea since it may represent objects with compiletimefixed bounds as
>> well. I think just "bounded" is the best.
>
> Strictly speaking, runtime bounded is not a superset of compile time bounded, because one cannot choose to do either with the runtime bounded class, right?
[...]
> Thus, "bounded" is insufficient for the runtime version as that name implies both categories and does not clearly suggest the runtime variability.
>
> 1 "bounded"
I'm not trying to say that runtime bounded is a superset of compile
time bounded, but that "bounded" is a superset of "bounded_int". You
can use "bounded" with static or dynamic bounds. There are even cases
when "bounded_int" cannot be used to define static bounds and you have
to use "bounded" instead – these are all the cases where the bounds
cannot be expressed directly using compile time constant expressions,
e.g. for floats or rational numbers. See the example with rational
numbers in the second part of this subsection:
http://tinyurl.com/332vmf5#constrained_value.tutorial.compile_time_fixed_bounds
2010/10/8 Thorsten Ottosen <nesotto_at_[hidden]>:
> What about namespaces?
>
> boost::constrained_values::run_time_bounds::bounded<int>
> boost::constrained_values::compile_time_bounds::bounded<int>
>
> ?
>
> Or
>
> boost::constrained_values::static_bounds::bounded<int>
> boost::constrained_values::dynamic_bounds::bounded<int>
>
> ?
Ditto.
Best regards,
Robert
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk