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

我的梦境 提交于 2019-11-28 11:10:45

std::experimental::optional originates from the Boost.Optional library, and this implementation works well in Visual C++ 12.0 (though it differs a little). Reference single-header implementation, based on the N3793 proposal paper, can be found here.

The latest list of supported C++11/14/1z core and library features that are shipped with Visual Studio can be found from the Visual C++ Team blog, from this post in particular. A set of header files of the Standard Library implementation (and some extensions) from Microsoft can be viewed here.

I've found that this implementation compiles with MSVC2013. Note that only compiles, everything else isn't guaranteed.

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

I was using this one for msvc2015 and it worked:

https://raw.githubusercontent.com/akrzemi1/Optional/master/optional.hpp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!