Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Visual C++ template instantiation
#include <iostream> #include <string> template <int& T>struct NonTypeParameter { }; //internal implementation int lala=0; template <typename T> struct Holder{ static int init; }; template <typename T> int Holder<T>::init = lala++; //tool for user template <typename T> struct InitCRTP{ using dummy=NonTypeParameter<Holder<T>::init>; }; class WantInit : public InitCRTP<WantInit>{};//user register easily int main(){ std::cout << lala << std::endl; }
run
|
edit
|
history
|
help
0
C++ move/copy constructor and assignment demo
Is min defined?
VC++ error LNK2001 with combined use of non-type template parameters
MSVC C++ runtime bug in dynamic_cast
Affine Key Finder and Decrypter
error_check
narrow_cast
Regex pipe and tabs c++
du
WinAPI not accessible