In C++26, optional will get reference support (this would make the iterator a forward-iterator). Alternatively, if we don't want to wait for that. Make a custom optional that supports references.
In C++26, optional will get reference support (this would make the iterator a forward-iterator).
Alternatively, if we don't want to wait for that. Make a custom optional that supports references.