3 ms·
There is no std::optional in earlier language standards. std::optional is a C++17 library feature.
by Kranar 5y ago
There is no std::optional in earlier language standards. std::optional is a C++17 library feature.
- PaulDavisThe1st 5y agoboost::optional has existed for many, many years and does not require compiler/language support. AFAIK, the behavior is substantially identical to std::optional.
- tsimionescu 5y agoEven for C++ 17, this is only guaranteed if you don't name the variable in your function. NRVO is not guaranteed at all. There is even an example downthread where gcc can't do it even at -O3.