Compiler Error C2765
'function' : an explicit specialization of a function template cannot have any default arguments
Default arguments are not allowed on an explicit specialization of a function template. For more information, see Explicit Specialization of Function Templates.
The following sample generates C2765:
// C2765.cpp
template<class T> void f(T t) {};
template<> void f<char>(char c = 'a') {} // C2765
// try the following line instead
// template<> void f<char>(char c) {}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for