Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
C++ instantiation
#include <iostream> #include <string> template <int& T>struct NonTypeParameter { }; template <typename T> struct Holder{ static int init; }; int lala=0; template <typename T> struct InitCRTP{ 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.
hangman
#26
Copy initialization: overload resolution issue
ria
error_code example
define own struct
no-thread
parantheses matching using stack in C++ - test
CommandQueue
VC++ latest rejects istream to nullptr comparison
Please log in to post a comment.