Default template parameter before parameter output to function?

The following compilation without problems in g ++:

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

Is it good that all standard compilers have a default template parameter ( OtherTypehere) after the default template parameter ( ReturnTypehere)?

+5
source share
1 answer

It's complicated. From the C ++ 11 specification:

- , - -, . - , . [. , (14.8.2).

, , , . .

, , , . .

+9

All Articles