on-internet
← Community

C++14's std::experimental::optional vs C++17's std::optional

Stack Overflow ·

What are the exact differences between C++14's std::experimental::optional and C++17's std::optional - other than the change of namespace? Note: I mean differences in the language standard text, not differences of concrete implementations. Motivation: In a library of mine, compatible with different C++ versions, I need an optional class template. I need to choose whether to use... "std::optional if C++17, otherwise a vendored implementation" or "std::optional if C++17, std::experimental::optional if C++14, otherwise a vendored implementation" My vendored implementation is Martin Moene's option

Comments

Sign in or sign up to comment and upvote.

No comments yet.