online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <functional> using namespace std; using Seed = float; class Syst { public: using Seed = float; std::function<void()> output; Syst() { output = [&]() { metaOutput(seed); }; } inline void setMetaOutput(std::function<void(Seed)>& _metaOutput) { metaOutput = _metaOutput; } inline void setInput(Seed _seed) { seed = _seed; } std::function<void(Seed)> metaOutput; Seed seed; }; class MetaSystem { public: using Seed = float; MetaSystem(){} inline void setMetaOutput(std::function<void(Seed)>& _metaOutput) { metaOutput = _metaOutput; } Syst getSystem(Seed seed){ Syst system = Syst(); system.setMetaOutput(metaOutput); system.setInput(seed); return system; } std::function<void(Seed)> metaOutput; }; int main() { MetaSystem metaSystem = MetaSystem(); std::function<void(Seed)> tempMetaOutput = [](Seed x) { cout << "hi" << endl; }; metaSystem.setMetaOutput(tempMetaOutput); Syst system = metaSystem.getSystem(10.f); system.output(); 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