
Simon Atanasyan wrote:
2007/10/11, John Maddock <john@johnmaddock.co.uk>:
Simon Atanasyan wrote:
The gcc results on that platform are pretty good, so it seems a shame not to support Sun as well, anyone have ideas?
Probably this is a bug in Sun C++. I will take a look on it.
Thanks Simon, if there's a workaround possible for the existing Sun releases that would be great.
Good news - the latest version of Sun C++ works good. This version of the compiler even does not need "Sun related" workaround in the boost/math/concepts/real_concept.hpp (lines 334-338).
Excellent.
Bad news - all other version of Sun C++ have a bug. Compiler cannot deduce a type of template parameter for the template specialization based on function return type. Here is test case for this bug:
A possible workaround is to add unused argument that helps compiler to handle template specialization: Following code works good:
template <class T> T f(T* = 0) { return T(); }
template <> float f(float*) { return 1.0; }
int main() { f<float>(); }
So this is the same issue for which we define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS and associated workarounds? If so which versions of __SUNPRO_CC should we define it for? Strangely the config tests don't pick this up: the test case is libs/config/test/boost_no_exp_func_tem_arg.ipp BTW. Thanks, John.