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
?
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.