From: Rob Stewart (stewart_at_[hidden])
Date: 2005-10-07 13:49:21
From: "Paul A Bristow" <pbristow_at_[hidden]>
| From: boost-bounces_at_[hidden]
> | [mailto:boost-bounces_at_[hidden]] On Behalf Of Robert Kawulak
> | I'm considering some changes in naming, in particular:
> | - I'd change 'constrained_type' to 'constrained',
> Sounds better IMO.
Agreed, but what is the corresponding namespace name,
"constraineds?" I wonder if constrained_types::constrained would
> | - I wonder if I should move 'constrained' and its aliases
> | ('boounded_int'
> | etc.) up form 'boost::constrained_types' namespace directly to 'boost'
> | namespace - these are things that are most likely to be used and maybe
> | 'boost' is better for them (or maybe, instead of moving them, using
> | declarations in 'boost' will suffice),
> Not sure.
They should not be in the boost namespace. Using directives,
declarations, and aliases can be used when desired. We don't
want to add more to the boost namespace than necessary. Besides,
if you later find that it is desirable, you only need this:
> | bounds_specifiers::integral_bounds ->
> | bounds_specifiers::integral
> | bounds_specifiers::generated_bounds ->
> | bounds_specifiers::generated
> | bounds_specifiers::static_bounds ->
> | bounds_specifiers::static
> Yes, _bounds doesn't add anything. Does the _specifiers add much?
> | - OTOH, the bounded policies' names seem to be to short and
> | not properly
> | chosen, I'd change their names so they say what the policy
> | does when an
> | attempt is made to assign an out-of-bounds value:
> | bounded_policies::error -> bounded_policies::failing
> | bounded_policies::wrap -> bounded_policies::wrapping
> | bounded_policies::clip -> bounded_policies::clipping
> I think the shorter is still clear - at least it isn't abbreviated.
> | - maybe changing the namespaces' names from plural to
> | singular would make
> | the names of policies more meaningful:
> | error_policies::throw_exception ->
> | error_policy::throw_exception
> | bounded_policies::error ->
> | bounded_policy::failing
> Yes singular is much better.
How about eliminating the separate namespace?
In use, those would look like this:
The first one doesn't look right to me as it somehow suggests
that the type is an error type (or is wrong!).
How about this variation:
Those are a bit verbose, but are possibly clearer.
Both of those are odd when you still have bounds::*. Maybe this
> | bounds_specifiers::static_bounds -> bounds_specifier::static
> As you noted static is forbidden. local_static is a bit long?
I like it. It's easy enough to document that the limits are/must
be compile time constants.
-- Rob Stewart stewart_at_[hidden] Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk