online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <memory> class U{ public: uint value; }; class T{ private: std::reference_wrapper<const U> _u; public: T(const U& u) :_u(u) {} const U& GetU(){ return _u; } }; const U& provideValue(U& u){ return u; } int main() { U internalApiValue; internalApiValue.value = 5; auto apiValue = provideValue(internalApiValue); T container(apiValue); std::cout << container.GetU().value; }

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