The problem is T one and 1.0 in the argument list of the template.
You cannot have a nontype template parameter for a floating point type, and you cannot pass a floating point value as a template argument. This is simply not allowed (as far as I know, there is really no good reason why this is not allowed).
Error message
g ++ is pretty useless here. Visual C ++ 2010 reports the following on the line where the template is used in main :
error C2993: 'double' : illegal type for non-type template parameter 'one'
Comeau Online Reports :
line 13: error: expression must have integral or enum type double d = exponentiel<double,1.0>(2.0f,3); ^ line 2: error: floating-point template parameter is nonstandard template <typename T, T one> ^
source share