没有<可选>在 MS Visual Studio 2013 中 - 该怎么做? [英] No <optional> in MS Visual Studio 2013 - what to do?
问题描述
我想使用 std::experimental::optional
,但 MSVS 2013 告诉我它找不到标题.
I want to use std::experimental::optional
, but MSVS 2013 tells me it can't find the header.
- 为什么它不在那里?
- 我可以根据其他地方的代码推出自己的代码吗?也许是 C++14 提案?
推荐答案
std::experimental::optional
源自 Boost.Optional 库,该实现在 Visual C++ 12.0 中运行良好(尽管它有所不同 一点).参考单头实现,基于 N3793 提案文件,可以在此处找到.
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.
可以从 Visual C++ 团队博客,来自 这篇文章.可以查看 Microsoft 的一组标准库实现(和一些扩展)的头文件 这里.
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.
这篇关于没有<可选>在 MS Visual Studio 2013 中 - 该怎么做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!