std::optional<std::reference_wrapper<T>> is how we deal with this [lovely isn't it?].
> Whenever the idea of an optional reference comes up, inevitably somebody will bring up the point that we don’t need to support optional<T&> because we already have in the language a perfectly good optional reference: T*.
But i have never heard this said even once. Rather, inevitably someone will bring up the point that you can do it with reference_wrapper. Check it out:
https://en.cppreference.com/w/cpp/utility/functional/referen...