Compiler Error C2785
'declaration1' and 'declaration2' have different return types
The return type of function template specialization differs from the return type of the primary function template.
To correct this error
- Check all specializations of the function template for consistency.
Example
The following sample generates C2785:
// C2785.cpp
// compile with: /c
template<class T> void f(T);
template<> int f(int); // C2785
template<> void f(int); // OK
Athugasemdir
https://aka.ms/ContentUserFeedback.
Væntanlegt: Á árinu 2024 munum við hætta með GitHub-mál sem ábendingaleið fyrir efni og skipta því út fyrir nýtt ábendingakerfi. Frekari upplýsingar er að finna hér:Senda inn og skoða endurgjöf fyrir