Run Code
|
API
|
Code Wall
|
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
map_file_mangling
std::current_exception makes a copy
default
virtual inheritance
ADL of operator expression & unqualified function call
Temp 1
rvalue lifetime
Test
Two-phase sample with Visual C++ 2015
atoi on hex