C++ futures part 1: The mental model
Summary
Raymond Chen’s post explains the mental model behind C++ futures by introducing a simplified internal 'source' object that underpins std::promise, std::packaged_task, std::async, std::future, and std::shared_future. The piece outlines the core operations of the state (set value, set exception, wait, and retrieval) and provides a concrete code sketch to illustrate synchronization, lifetime, and error handling. This sets the stage for subsequent installments that will cover std::promise, std::packaged_task, and std::async in more detail.