|
Boost : |
From: Robert Kawulak (kawulak_at_[hidden])
Date: 2005-09-29 01:32:24
Hi,
> From: Simon Buchan
> [sig?]
What's this?
> > In bounded policies I use
> > passed_value_type initialize()
> > where passed_value_type is value_type for integral types and const
> > value_type & for other types. The second returns a
> reference to a static
> > object - that's the most efficient method I can think of,
> initialization
> > takes only one copy-construction (for details please look
> into the code).
>
> ref to static? It feels cludgy.
It's not a static created only for initialisations. Bounds specifier's
functions min_value() and max_value() create function-scope static objects
and return them, this way the objects aren't being created every time the
functions are called (and they're called very often, so I think this is
reasonable for non-integral types). And initialize() only returns
min_value() and that's it.
> > Uhh, maybe you're right ;-) I don't know why, but it just
> "byte my eyes"
> > when I see a type named "something_value"... Nevermind, if
> people here
> > really resist that it should be called constrained_value instead of
> > constrained_type, then OK - I'll change it.
>
> Why not just 'constrained'? ie. constrained<int>?
Sounds good, and how to call the library? 'constrained_types'?
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