No <optional> in MS Visual Studio 2013 - what to do?

I want to use std::experimental::optional , but MSVS 2013 tells me that it cannot find the header.

  • Why is this not so?
  • Can I use custom code based on code elsewhere? Perhaps a C ++ 14 sentence?
+8
visual-studio-2013 c ++ 14 c ++ - standard-library optional c ++ 17
source share
2 answers

std::experimental::optional comes from the Boost.Optional library, and this implementation works well in Visual C ++ 12.0 (although it is slightly different from). An implementation of a single-user link based on proposal document N3793 can be found.

The latest list of supported C ++ 11/14 / 1z core and library functions supplied with Visual Studio can be found in the Visual C ++ Team blog , from this post in particular. The set of header files for implementing the standard library (and some extensions) from Microsoft can be viewed here .

+10
source share

I found that this implementation compiles using MSVC2013. Please note that only compiles, everything else is not guaranteed.

https://github.com/mapbox/variant/blob/master/include/mapbox/optional.hpp

0
source share

All Articles