promise
A promise is an object that can store a value of type T to be retrieved by a future object (possibly in another thread), offering a synchronization point. ``` #include <iostream> #include <future> using namespace std; int main() { auto p = promise<string>(); auto f = p.get_future(); auto producer = thread([&] { p.set_value("Hello World"); }); producer.join(); auto consumer = thread([&] { cout << f.get(); }); consumer.join(); } ```