Being lazy in C++
Summary
The article explains lazy initialization in C++ with an example of std::optional and value_or. It shows why value_or(complex_computation()) runs the computation, proposes a Lazy wrapper to defer evaluation, and discusses limitations such as lack of memoization and potential pitfalls. It also mentions upcoming improvements and references MSVC STL behavior.