C++ (Qt)template<class T, T t> class TmplTest{ }; int var = 0; int main(){ TmplTest<void*, nullptr> tmplTest1; // OK TmplTest<int*, &var> tmplTest2; // OK TmplTest<void*, (void*)(-1)> tmplTest3; // FAIL in MinGW!!! return 0;}
main.cpp: In function 'int main()':main.cpp:14:29: error: '4294967295u' is not a valid template argument for 'void*' because it is not the address of a variable TmplTest<void*, (void*)(-1)> tmplTest3; // FAIL!!! ^main.cpp:14:40: error: invalid type in declaration before ';' token TmplTest<void*, (void*)(-1)> tmplTest3; // FAIL!!! ^
C++ (Qt)template<typename HandleType = HANDLE, WINBOOL (WINAPI * destructor)(HandleType) = CloseHandle, HandleType defaultValue = INVALID_HANDLE_VALUE>class UniqueHandle{...}