Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2005-05-08 05:05:09


>> Static constants in "<type>_constants"-namespaces are also undesirable,
>> because there is no way to select a namespace named "<T>_constants" from
>> within a template.
>
> FWIW thi would work fine for me:
>
> typedef std::math::constants<T> math;
> 2 * math::pi * r ;

Except you can't then add new constants without changing the definition of
math_constants. If you use a namespace for the "container" and
free-standing template functions, then you can either:

Add new constants.
Add support for new types.

Without changing the existing code.

John.


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