Compiler Error C2762
'class' : invalid expression as a template argument for 'argument'
When using /Za, the compiler will not convert an integral to a pointer.
The following sample generates C2762:
// C2762.cpp
// compile with: /Za
template<typename T, T *pT>
class X2 {};
void f2() {
X2<int, 0> x21; // C2762
// try the following line instead
// X2<int, static_cast<int *>(0)> x22;
}
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