Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Visual C++ template instantiation
#include <iostream> #include <string> template <int& T>struct NonTypeParameter { }; template <typename T> class Holder{ public: static int init; }; int lala=0; template <typename T> class InitCRTP{ public: using dummy=NonTypeParameter<Holder<T>::init>; }; template <typename T> int Holder<T>::init = lala++; class WantInit : public InitCRTP<WantInit>{}; int main(){ std::cout << lala << std::endl; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
new
enable_if::type
delete from list
Template float/int comparison
wrong up
virtual inheritance
variable template not supported
a parameter pack
VS struct_member_name
Affine Key Finder and Decrypter
Please log in to post a comment.