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
Hangman
MSVC C++ runtime bug in dynamic_cast
Template float/int comparison
Problem_rstring_1
CT1
Unicode_wcout
Eight Queen
kkk
Postfix side effect returning 2
virtual test