Default template parameter before deduced parameter in a function?

Viewed 133

The following compile with no problem in g++ :

template<typename ReturnType = double, typename OtherType> ReturnType func(const OtherType& var)
{
    ReturnType result = 0;
    /* SOMETHING */
    return result;
}

Is it ok for all standard-compliant compilers to have a not-defaulted template parameter (OtherType here) after a defaulted template parameter (ReturnType here) ?

1 Answers
Related