C++ future-promise
Using C++ 11 feature and locking the object automatically with future-promise idiom. \n\n\nclass Foo {\npublic:\n    Foo() {\n        \n    }\n    std::promise<
Using C++ 11 feature and locking the object automatically with future-promise idiom. \n\n```\nclass Foo {\npublic:\n    Foo() {\n        \n    }\n    std::promise<void> one, two;\n    \n    void first(function<void()> printFirst) {\n        printFirst();\n        one.set_value();\n    }\n\n    void second(function<void()> printSecond) {\n        one.get_future().get();\n        printSecond();\n        two.set_value();\n    }\n\n    void third(function<void()> printThird) {\n        two.get_future().get();\n        printThird();\n\n    }\n};\n```
[]