C++ SHORTEST CODE USING PROMISE CLASS
\nclass Foo {\n    \nprivate:    \n    promise<void> p1, p2;    \n    \npublic:\n    Foo() {}\n    void first(function<void()> printFirst)         {\n        pr
```\nclass Foo {\n    \nprivate:    \n    promise<void> p1, p2;    \n    \npublic:\n    Foo() {}\n    void first(function<void()> printFirst)         {\n        printFirst()                                ;\n        p1.set_value()                              ;\n                                                    }\n    void second(function<void()> printSecond)       {\n        p1.get_future().wait()                      ;\n        printSecond()                               ;\n        p2.set_value()                              ;}\n\n    void third(function<void()> printThird)         {\n        p2.get_future().wait()                      ;\n        printThird()                                ;}\n};\n```
['C']