Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Visual C++ template instantiation
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
#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; }
cl.exe
/std:c++17
Show compiler warnings
[
+
] Compiler args
[
-
]
Show input
Compilation time: 1,9 sec, absolute running time: 0,33 sec, absolute service time: 2,24 sec
edit mode
|
history
|
discussion
0