Is
std::optional<std::reference_wrapper<some_type>>
is conforming to the Standard (or draft) of C++17?
The Standard explicitly says, that std::optional
for a reference type is ill-formed. But does it include reference_wrapper
?
Yes. That is OK. It does not include reference_wrapper because reference_wapper isn't a reference type. Only actual reference types are disallowed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With