Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2005-10-06 11:20:03


 

| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]] On Behalf Of Robert Kawulak
| Sent: 05 October 2005 10:33
| To: boost_at_[hidden]
| Subject: Re: [boost] [constrained_types] Naming changes
|
| I'm considering some changes in naming, in particular:
|
| - I'd change 'constrained_type' to 'constrained',

Sounds better IMO.

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

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

Yes, _bounds doesn't add anything. Does the _specifiers add much?

  bounds::integral
  bounds::generated
  bounds::fixed

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

| bounds_specifiers::static_bounds -> bounds_specifier::static

As you noted static is forbidden. local_static is a bit long?

bounds::fixed

perhaps???

I shouldn't get too concerned about the names for now. They are fairly easy
to change with global edits, even in the documentation.

You might like to consider your code could be used by the date_time library
(which already uses constrained types) and perhaps elsewhere in existing
Boost libraries.
Ease of plug-in will be a major 'selling' point.

And of course documentation including many examples is VERY important.

Looking good to me but I haven't looked in detail or used it in anger yet.

Paul

Paul A Bristow
Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB
+44 1539 561830 +44 7714 330204
mailto: pbristow_at_[hidden] www.hetp.u-net.com


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