The following code:
std::optional<std::string> so;
std::cout << so->size() << std::endl;
std::cout << so.has_value();
outputs:
0
0
My question is whether its safe to call : so->size() on an empty optional. I used clang sanitizer, but it didnt report any UB in above code.