
"Tobias Schwinger" <tschwinger@neoscientists.org> wrote
Andy Little wrote:
"Tobias Schwinger" <tschwinger@neoscientists.org> wrote
- there is no way to pass constants as a type template argument.
( IOW use a function ..? )
No. A class somehow like this:
template<typename T> struct name;
template<> struct name<TYPE> { operator TYPE() const { return ... }; TYPE operator() () const { return ... }; };
FWIW I had alook at this approach yesterday. see "test.cpp" attached. I think it could be made to work. In unary contexts it requires explicit conversion, but I guess there is no way around that. Of course you need an object.. boost::math::pi pi ; or a temporary.. boost::math::pi() ;. However I guess this means you can use either pi or pi() syntax ... :-) regards Andy Little