online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> template <bool present> struct base; template <> struct base<true> { int x; }; template <bool present> struct base { }; struct Nothing {}; struct StaticNothing { static Nothing x; }; template <bool activate> struct A : public base<activate>, StaticNothing { using std::conditional_t<activate, base<true>, StaticNothing>::x; void print() const; }; template <bool activate> void A<activate>::print() const { if constexpr (activate) { std::cout << "x = " << x << std::endl; } else { std::cout << "nothing" << std::endl; } } int main() { A<true> a; a.print(); A<false> b; b.print(); return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue