online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <functional> #include <vector> using namespace std; class Red { public: template <typename F, typename M> void addToVector(F f, M m) { //---------------------------vvvvvvv----------->changed this list.push_back([=](){ return (m->*f)(); }); cout<<"Function added."; } std::vector<std::function<void()>> list; }; class Blue { public: Blue() { r.addToVector(&Blue::someFunc, this); } void someFunc(){ cout<<"Some print."; } Red r; }; int main() { Blue b; 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