
8 May
2005
8 May
'05
11:06 a.m.
Andy Little wrote:
"Tobias Schwinger" <tschwinger@neoscientists.org> wrote
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 ;
This looks nice at first glance. Besides getting rid of the empty parentheses, there are the following disadvantages: - modularity/extensibility (once constants<T> is defined you can't add constants to it) - portability (the code above won't compile with BCC) - there is no way to pass constants as a type template argument Regards, Tobias