Is '_HAS_CXX17' marco usable in custom project headers to enable C++17 language set features?
问题 I want to create headers which use 'optional' from standard C++. However, My headers will be referred from Visual Studio 2015 as well as Visual Studio 2017 projects. I would like to have something, such that for Visual Studio 2017 ( with C++ 17 lang feature set) , std::optional is used and with Visual Studio 2015, boost::optional gets used. I am thinking of something like this: #include <yvals.h> #if _HAS_CXX17 #include <optional> template <typename T> using Optional = std::optional<T>; #else