Boost logo

Boost :

From: Jeff Garland (jeff_at_[hidden])
Date: 2005-10-06 09:07:09


On Wed, 5 Oct 2005 11:32:39 +0200, Robert Kawulak wrote
> Hi everybody,
>
> > From: Robert Kawulak
> > I didn't change the name of constrained_type template to
> > constrained yet,
> > but if this shorter form is OK then I'll do this before next update.
>
> I'm considering some changes in naming, in particular:
>
> - I'd change 'constrained_type' to 'constrained',
>
> - 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),

I wouldn't put things directly into the boost namespace. It's not a big deal
for people to get used to using or aliasing boost::constrained_types.

> - the bounds specifiers are in 'boost::constrained_types::bounds_specifiers'
> namespace, so maybe there's no need to add '_bounds' to each name at
> the end:
>
> bounds_specifiers::integral_bounds -> bounds_specifiers::integral
> bounds_specifiers::generated_bounds -> bounds_specifiers::generated
> bounds_specifiers::static_bounds -> bounds_specifiers::static

Makes sense.

> - 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

Probably better...

> - 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
> bounds_specifiers::static_bounds -> bounds_specifier::static

I prefer the plural.

Jeff


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