Does it make sense to combine optional with reference_wrapper?
问题 It occurred to me that in C++ it is possible to use the type std::optional<std::reference_wrapper<T>> . An object of this type is essentially a reference to an object of type T or a null value, i.e., pretty much a pointer. My questions: Is there any conceptual difference between std::optional<std::reference_wrapper<T>> and T* ? Is there any practical difference? Are there situations where it might be advisable to choose std::optional<std::reference_wrapper<T>> over T* ? 回答1: Is there any