online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <functional> using namespace std; template<typename T, typename... U> size_t getAddress(std::function<T(U...)> f) { typedef T(fnType)(U...); fnType ** fnPointer = f.template target<fnType*>(); return (size_t) *fnPointer; } void foo(int& a) { a = 0; } int main() { std::function<void(int&)> f = &foo; auto f2 = f; std::function<void(int&)> f3 = [](int &a){ a = 3;}; std::cout << getAddress(f) << std::endl; std::cout << getAddress(f2) << std::endl; std::cout << getAddress(f3) << std::endl; 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