online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <unordered_set> #include <iostream> class Fooable { public: Fooable() { registered.insert(this); } ~Fooable() { registered.erase(this); } virtual void fooify() = 0; static void fooify_all() { for(auto * f : registered) f->fooify(); } private: static std::unordered_set<Fooable*> registered; }; class Fruit : private Fooable { void fooify() override { std::cout << "Fruit::fooify" << std::endl; } }; class Apple : public Fruit, private Fooable { void fooify() override { std::cout << "Apple::fooify" << std::endl; } }; std::unordered_set<Fooable*> Fooable::registered; int main() { Apple a; Fooable::fooify_all(); 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