I learned about the new range API of std::optional from Steve Downey at CppCon 2025 during his talk about std::optional. To be honest, I found the idea quite strange at first. I wanted to dig deeper to understand the motivation and the implications. The first example I encountered was this: 1 2 3 4 5 6 7 void doSomething(std::string const& data, std::optional logger = {}) { for (auto l : logger) { l.log(data); } return; } This shows that you can iterate over an optional. In fact, iterating ov...| Sandor Dargo’s Blog