
8 May
2005
8 May
'05
10:05 a.m.
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.