Visual C++ 语言一致性Visual C++ Language Conformance

本主题概述了 Visual Studio 2017 及早期版本中的 C++ 编译器的编译器功能和标准库功能的 ISO C++03、C++11、C++14、C++17 以及 C++20 草稿语言标准符合性。This topic summarizes the ISO C++03, C++11, C++14, C++17, and Draft C++20 language standards conformance of compiler features and Standard Library features for the C++ compiler in Visual Studio 2017 and earlier versions. 每个编译器和标准库功能名称都可链接到介绍该功能的 ISO C++ 标准建议文章(如果在发布时可用)。Each compiler and standard library feature name links to the ISO C++ Standard proposal paper that describes the feature, if one is available at publication time. “支持”列中列出了首次出现在其中并支持该功能的 Visual Studio 版本。The Supported column lists the Visual Studio version in which support for the feature first appeared.

若要深入了解 Visual Studio 2017 中的一致性改进和其他更改,请参阅 Visual Studio 2017 中 C++ 的一致性改进Visual Studio 2017 中 Visual C++ 的新增功能For details on conformance improvements and other changes in Visual Studio 2017, see C++ conformance improvements in Visual Studio 2017 and What's New for Visual C++ in Visual Studio 2017. 若要了解早期版本中的一致性更改,请参阅 Visual C++ 更改历史记录2003 至 2015 各版本中 Visual C++ 的新增功能For conformance changes in earlier versions, see Visual C++ change history and Visual C++ What's New 2003 through 2015. 有关来自 C++ 团队的最新信息,请访问 Visual C++ 团队博客For current news from the C++ team, visit the Visual C++ team blog.


Visual Studio 2015 和 Visual Studio 2017 之间没有二进制的重大更改。There are no binary breaking changes between Visual Studio 2015 and Visual Studio 2017.

编译器功能Compiler Features

功能区域Feature Area
C++03/11 核心语言功能C++03/11 Core Language Features 支持Supported
  其他所有内容  Everything else VS 2015 AVS 2015 A
  两阶段名称查找  Two-phase name lookup VS 2017 15.7 BVS 2017 15.7 B
  N2634 表达式 SFINAE  N2634 Expression SFINAE VS 2017 15.7VS 2017 15.7
  N1653 C99 预处理器  N1653 C99 preprocessor 部分 DPartial D
  N1988 扩展的整型  N1988 Extended integer types N/A EN/A E
C++ 14 核心语言功能C++14 Core Language Features 支持Supported
  N3323 上下文转换的已调整 wording  N3323 Tweaked wording for contextual conversions VS 2013VS 2013
  N3472 二进制文本  N3472 Binary literals VS 2015VS 2015
  N3638 auto 和 decltype(auto) 返回类型  N3638 auto and decltype(auto) return types VS 2015VS 2015
  N3648 init-captures  N3648 init-captures VS 2015VS 2015
  N3649 泛型 lambda  N3649 Generic lambdas VS 2015VS 2015
  N3760 [[已弃用]] 属性  N3760 [[deprecated]] attribute VS 2015VS 2015
  N3778 调整大小的释放  N3778 Sized deallocation VS 2015VS 2015
  N3781 数字分隔符  N3781 Digit separators VS 2015VS 2015
  N3651 变量模板  N3651 Variable templates VS 2015.2VS 2015.2
  N3652 扩展的 constexpr  N3652 Extended constexpr VS 2017VS 2017
  N3653 聚合的 NSDMI  N3653 NSDMIs for aggregates VS 2017VS 2017
  N3664 避免/合成分配  N3664 Avoiding/fusing allocations N/A FN/A F
C++ 17 核心语言功能C++17 Core Language Features 支持Supported
  N4086 删除三字符组  N4086 Removing trigraphs VS 2010 14VS 2010 14
  N3922 针对自动使用大括号内的初始值设定项列表的新建规则  N3922 New rules for auto with braced-init-lists VS 2015 14VS 2015 14
  N4051 模板-参数模板的类型名称  N4051 typename in template template-parameters VS 2015 14VS 2015 14
  N4266 命名空间和枚举器的属性  N4266 Attributes for namespaces and enumerators VS 2015 14VS 2015 14
  N4267 u8 字符文本  N4267 u8 character literals VS 2015 14VS 2015 14
  N4230 嵌套的命名空间定义  N4230 Nested namespace definitions VS 2015.3 17VS 2015.3 17
  N3928 简要静态断言  N3928 Terse static_assert VS 2017 17VS 2017 17
  P0184R0 一般化的基于范围的 for 循环  P0184R0 Generalized range-based for-loops VS 2017 14VS 2017 14
  P0188R1 [[fallthrough]] 属性  P0188R1 [[fallthrough]] attribute VS 2017 17VS 2017 17
  P0001R1 删除 register 关键字  P0001R1 Removing the register keyword VS 2017 15.3 17VS 2017 15.3 17
  P0002R1 删除 bool 的 operator++  P0002R1 Removing operator++ for bool VS 2017 15.3 17VS 2017 15.3 17
  P0018R3 按值捕获 *this  P0018R3 Capturing *this by value VS 2017 15.3 17VS 2017 15.3 17
  P0028R4 不重复使用属性命名空间  P0028R4 Using attribute namespaces without repetition VS 2017 15.3 17VS 2017 15.3 17
  P0061R1 __has_include  P0061R1 __has_include VS 2017 15.3 14VS 2017 15.3 14
  P0138R2 直接列表初始化整数中的固定枚举  P0138R2 Direct-list-init of fixed enums from integers VS 2017 15.3 17VS 2017 15.3 17
  P0170R1 constexpr lambda  P0170R1 constexpr lambdas VS 2017 15.3 17VS 2017 15.3 17
  P0189R1 [[nodiscard]] 属性  P0189R1 [[nodiscard]] attribute VS 2017 15.3 17VS 2017 15.3 17
  P0212R1 [[maybe_unused]] 属性  P0212R1 [[maybe_unused]] attribute VS 2017 15.3 17VS 2017 15.3 17
  P0217R3 结构化绑定  P0217R3 Structured bindings VS 2017 15.3 17VS 2017 15.3 17
  P0292R2 constexpr if 语句  P0292R2 constexpr if-statements VS 2017 15.3 GVS 2017 15.3 G
  P0305R1 具有初始化表达式的选择语句  P0305R1 Selection statements with initializers VS 2017 15.3 17VS 2017 15.3 17
  P0245R1 Hexfloat 文本  P0245R1 Hexfloat literals VS 2017 15.5 17VS 2017 15.5 17
  N4268 允许更多非类型模板参数  N4268 Allowing more non-type template args VS 2017 15.5 17VS 2017 15.5 17
  N4295 折叠表达式  N4295 Fold expressions VS 2017 15.5 17VS 2017 15.5 17
  P0003R5 删除动态-异常-规范  P0003R5 Removing dynamic-exception-specifications VS 2017 15.5 17VS 2017 15.5 17
  P0012R1 向类型系统添加 noexcept  P0012R1 Adding noexcept to the type system VS 2017 15.5 17VS 2017 15.5 17
  P0035R4 过度对齐的动态内存分配  P0035R4 Over-aligned dynamic memory allocation VS 2017 15.5 17VS 2017 15.5 17
  P0386R2 内联变量  P0386R2 Inline variables VS 2017 15.5 17VS 2017 15.5 17
  P0522R0 将template-parameters 模板与兼容参数匹配  P0522R0 Matching template template-parameters to compatible arguments VS 2017 15.5 17VS 2017 15.5 17
  P0036R0 删除某些空的一元折叠  P0036R0 Removing some empty unary folds VS 2017 15.5 17VS 2017 15.5 17
  N4261 修复限定转换  N4261 Fixing qualification conversions VS 2017 15.7 17VS 2017 15.7 17
  P0017R1 扩展的聚合初始化  P0017R1 Extended aggregate initialization VS 2017 15.7 17VS 2017 15.7 17
  P0091R3 类模板的模板参数推导  P0091R3 Template argument deduction for class templates
  P0512R0 类模板参数推导问题  P0512R0 Class template argument deduction issues
VS 2017 15.7 17VS 2017 15.7 17
  P0127R2 使用 auto 声明非类型模板参数  P0127R2 Declaring non-type template parameters with auto VS 2017 15.7 17VS 2017 15.7 17
  P0135R1 保证副本省略  P0135R1 Guaranteed copy elision VS 2017 15.6HVS 2017 15.6H
  P0136R1 重新组织继承构造函数  P0136R1 Rewording inheriting constructors VS 2017 15.7 17VS 2017 15.7 17
  P0137R1 std::launder  P0137R1 std::launder VS 2017 15.7 17VS 2017 15.7 17
  P0145R3 改进表达式计算顺序  P0145R3 Refining expression evaluation order
  P0400R0 函数参数的计算顺序  P0400R0 Order of evaluation of function arguments
VS 2017 15.7 17VS 2017 15.7 17
  P0195R2 using 声明中的包扩展  P0195R2 Pack expansions in using-declarations VS 2017 15.7 17VS 2017 15.7 17
  P0283R2 忽略无法识别的属性  P0283R2 Ignoring unrecognized attributes VS 2015 14VS 2015 14
  P0702R1 修复 initializer-list ctor 的类模板参数推导  P0702R1 Fixing class template argument deduction for initializer-list ctors VS 2017 15.7 17VS 2017 15.7 17
功能区域Feature Area
C++17 核心语言功能(缺陷报告)C++17 Core Language Features (Defect Reports) 支持Supported
  P0702R1 修复 initializer-list ctor 的类模板参数推导  P0702R1 Fixing class template argument deduction for initializer-list ctors VS 2017 15.7 17VS 2017 15.7 17
  P0588R1 简化隐式 lambda 捕获  P0588R1 Simplifying implicit lambda capture No
  CWG 1581:何时定义 constexpr 成员函数?  CWG 1581: When are constexpr member functions defined? No
  P0962R1 放宽结构化绑定的自定义点查找规则  P0962R1 Relaxing the structured bindings customization point finding rules No
  P0962R2 放宽 range-for 循环的自定义点查找规则  P0962R2 Relaxing the range-for loop customization point finding rules No
  P0969R0 允许对可访问的成员进行结构化绑定  P0969R0 Allowing structured bindings to accessible members No
功能区域Feature Area
C++20 核心语言功能C++20 Core Language Features 支持Supported
  P0306R4 添加 __VA_OPT_&#95 用于省略和删除逗号  P0306R4 Adding __VA_OPT__ for comma omission and comma deletion No
  P0329R4 指定的初始化  P0329R4 Designated initialization No
  P0409R2 允许 lambda 捕获 [=, this]  P0409R2 Allowing lambda-capture [=, this] No
  P0428R2 泛型 lambda 的熟悉模板语法  P0428R2 Familiar template syntax for generic lambdas No
  P0683R1 位域的默认成员初始化表达式  P0683R1 Default member initializers for bit-fields No
  P0704R1 修复指向成员的 const 左值引用限定的指针  P0704R1 Fixing const lvalue ref-qualified pointers to members No
  P0734R0 概念  P0734R0 Concepts No

标准库功能Standard Library Features

功能区域Feature Area
C++20 标准库功能C++20 Standard Library Features 支持Supported
  P0777R1 避免不必要的衰减   P0777R1 Avoiding Unnecessary Decay VS 2017 15.7 14VS 2017 15.7 14
  P0463R1 endian  P0463R1 endian No
  P0674R1 数组的 make_shared()  P0674R1 make_shared() For Arrays No
  P0858R0 Constexpr 迭代器要求  P0858R0 Constexpr Iterator Requirements VS 2017 15.3 17VS 2017 15.3 17
  P0809R0 比较无序容器  P0809R0 Comparing Unordered Containers VS 2010 14VS 2010 14
   P0020R3 原子<float>,原子<double>,原子<long double>   P0020R3 atomic<float>, atomic<double>, atomic<long double> No
  P0053R7 <syncstream>   P0053R7 <syncstream>
  P0753R2 osyncstream 操控器   P0753R2 osyncstream Manipulators
  P0122R7 <span>   P0122R7 <span> No
  P0202R3 <algorithm> 和 exchange() 的 constexpr   P0202R3 constexpr For <algorithm> And exchange() No
  P0355R7 <chrono> 日历和时区   P0355R7 <chrono> Calendars And Time Zones No
  P0415R1 <complex>(重新)的 constexpr   P0415R1 constexpr For <complex> (Again) No
  P0439R0 枚举类 memory_order   P0439R0 enum class memory_order No
  P0457R2 basic_string/basic_string_view 的 starts_with()/ends_with()   P0457R2 starts_with()/ends_with() For basic_string/basic_string_view No
  P0550R2 remove_cvref   P0550R2 remove_cvref No
  P0551R3 不应将 std 函数模板专用化!   P0551R3 Thou Shalt Not Specialize std Function Templates! No
  P0600R1 STL 第 1 部分的 [[nodiscard]]    P0600R1 [[nodiscard]] For The STL, Part 1 No
  P0616R0 在 <numeric> 中使用 move()   P0616R0 Using move() In <numeric> No
  P0653R2 to_address()   P0653R2 to_address() No
  P0718R2 原子<shared_ptr<T>>、原子<weak_ptr<T>>   P0718R2 atomic<shared_ptr<T>>, atomic<weak_ptr<T>> No
  P0754R2<version>   P0754R2 <version> No
  P0767R1 弃用 is_pod   P0767R1 Deprecating is_pod No
  P0768R1 太空船比较运算符的库支持<=>   P0768R1 Library Support For The Spaceship Comparison Operator <=> No
  P0966R1 string::reserve() 不应缩减   P0966R1 string::reserve() Should Not Shrink No
C++17 标准库功能C++17 Standard Library Features 支持Supported
  P0433R2 将类模板的模板推导集成到标准库中  P0433R2 Integrating template deduction for class templates into the standard library
  P0739R0 改进集成到标准库中的类模板参数推导  P0739R0 Improving class template argument deduction integration into the standard library
VS 2017 15.7VS 2017 15.7
  P0426R1 char_traits 的 constexpr  P0426R1 constexpr For char_traits VS 2017 15.7VS 2017 15.7
  P0030R1 hypot(x, y, z)  P0030R1 hypot(x, y, z) VS 2017 15.7VS 2017 15.7
  P0220R1 Library Fundamentals V1  P0220R1 Library Fundamentals V1 VS 2017 15.6 JVS 2017 15.6 J
  P0067R5 基本字符串转换  P0067R5 Elementary String Conversions VS 2017 15.7 charconvVS 2017 15.7 charconv
  N4562 库基础知识:<memory_resource>  N4562 Library Fundamentals: <memory_resource>
  P0337R0 删除 polymorphic_allocator 分配  P0337R0 Deleting polymorphic_allocator Assignment
VS 2017 15.6VS 2017 15.6
  P0024R2 并行算法  P0024R2 Parallel Algorithms
  P0336R1 重命名并行执行策略  P0336R1 Renaming Parallel Execution Policies
  P0394R4 并行算法应该对异常调用 terminate()  P0394R4 Parallel Algorithms Should terminate() For Exceptions
  P0452R1 统一 <numeric> 并行算法  P0452R1 Unifying <numeric> Parallel Algorithms
VS 2017 15.7VS 2017 15.7
  P0226R1 特殊数学函数  P0226R1 Mathematical Special Functions VS 2017 15.7VS 2017 15.7
  P0218R1 <filesystem>  P0218R1 <filesystem>
  P0219R1 文件系统的相对路径  P0219R1 Relative Paths For Filesystem
  P0317R1 文件系统的目录项缓存  P0317R1 Directory Entry Caching For Filesystem
  P0392R0 文件系统路径中支持 string_view  P0392R0 Supporting string_view In Filesystem Paths
  P0430R2 支持非 POSIX 文件系统  P0430R2 Supporting Non-POSIX Filesystems
  P0492R2 解析文件系统的 NB 注释  P0492R2 Resolving NB Comments for Filesystem
VS 2017 15.7 KVS 2017 15.7 K
  P0003R5 删除动态异常规范  P0003R5 Removing Dynamic Exception Specifications VS 2017 15.5 17VS 2017 15.5 17
  P0005R4 not_fn()  P0005R4 not_fn()
  P0358R1 not_fn() 的修补程序  P0358R1 Fixes For not_fn()
VS 2017 15.5 17VS 2017 15.5 17
  P0033R1 重新组织 enable_shared_from_this  P0033R1 Rewording enable_shared_from_this VS 2017 15.5 14VS 2017 15.5 14
  P0083R3 拼接映射和集  P0083R3 Splicing Maps And Sets
  P0508R0 阐明 insert_return_type  P0508R0 Clarifying insert_return_type
VS 2017 15.5 17VS 2017 15.5 17
  P0174R2 弃用残留库部分  P0174R2 Deprecating Vestigial Library Parts VS 2017 15.5 17VS 2017 15.5 17
  P0302R1 删除 std::function 中的分配器支持  P0302R1 Removing Allocator Support In std::function VS 2017 15.5 17VS 2017 15.5 17
  P0414R2 shared_ptr<T[]>、shared_ptr<T[N]>  P0414R2 shared_ptr<T[]>, shared_ptr<T[N]>
  P0497R0 修复数组的 shared_ptr  P0497R0 Fixing shared_ptr For Arrays
VS 2017 15.5 14VS 2017 15.5 14
  P0521R0 弃用 shared_ptr::unique()  P0521R0 Deprecating shared_ptr::unique() VS 2017 15.5 17VS 2017 15.5 17
  P0607R0 标准库的内联变量  P0607R0 Inline Variables for the Standard Library VS 2017 15.5 17VS 2017 15.5 17
  P0618R0 弃用 <codecvt>  P0618R0 Deprecating <codecvt> VS 2017 15.5 17VS 2017 15.5 17
  N4562 库基础知识:Boyer Moore search()  N4562 Library Fundamentals: Boyer-Moore search()
  P0253R1 修复搜索器返回类型  P0253R1 Fixing Searcher Return Types
VS 2017 15.3 17VS 2017 15.3 17
  P0031R0 <数组> (Again) 和 <迭代器>的 constexpr  P0031R0 constexpr For <array> (Again) And <iterator> VS 2017 15.3 17VS 2017 15.3 17
  P0040R3 扩展内存管理工具  P0040R3 Extending Memory Management Tools VS 2017 15.3 17VS 2017 15.3 17
  P0084R2 Emplace 返回类型  P0084R2 Emplace Return Type VS 2017 15.3 17VS 2017 15.3 17
  P0152R1 atomic::is_always_lock_free  P0152R1 atomic::is_always_lock_free VS 2017 15.3 17VS 2017 15.3 17
  P0154R1 hardware_destructive_interference_size 等  P0154R1 hardware_destructive_interference_size, etc. VS 2017 15.3 17VS 2017 15.3 17
  P0156R2 将可变参数 lock_guard 重命名为 scoped_lock  P0156R2 Renaming Variadic lock_guard to scoped_lock VS 2017 15.3 17VS 2017 15.3 17
  P0258R2 has_unique_object_representations  P0258R2 has_unique_object_representations VS 2017 15.3 LVS 2017 15.3 L
  P0295R0 gcd()、lcm()  P0295R0 gcd(), lcm() VS 2017 15.3 17VS 2017 15.3 17
  P0298R3 std::byte  P0298R3 std::byte VS 2017 15.3 17byteVS 2017 15.3 17, byte
  P0403R1 <string_view>(“meow”sv 等)的 UDL  P0403R1 UDLs For <string_view> ("meow"sv, etc.) VS 2017 15.3 17VS 2017 15.3 17
  P0418R2 原子 compare_exchange memory_order 要求  P0418R2 atomic compare_exchange memory_order Requirements VS 2017 15.3 14VS 2017 15.3 14
  P0435R1 修改 common_type  P0435R1 Overhauling common_type
  P0548R1 调整 common_type 和持续时间  P0548R1 Tweaking common_type and duration
VS 2017 15.3 14VS 2017 15.3 14
  P0505R0 <chrono> (Again) 的 constexpr  P0505R0 constexpr For <chrono> (Again) VS 2017 15.3 17VS 2017 15.3 17
  P0513R0 中毒哈希  P0513R0 Poisoning hash
  P0599R1 noexcept 哈希  P0599R1 noexcept hash
VS 2017 15.3 14VS 2017 15.3 14
  P0516R0 将 shared_future 复制标记为 noexcept  P0516R0 Marking shared_future Copying As noexcept VS 2017 15.3 14VS 2017 15.3 14
  P0517R0 从 future_errc 构造 future_error  P0517R0 Constructing future_error From future_errc VS 2017 15.3 14VS 2017 15.3 14
  P0558R1 解决 atomic 已命名基类不一致的问题  P0558R1 Resolving atomic Named Base Class Inconsistencies VS 2017 15.3 14VS 2017 15.3 14
  P0604R0 将 is_callable/result_of 更改为 invoke_result、is_invocable、is_nothrow_invocable  P0604R0 Changing is_callable/result_of To invoke_result, is_invocable, is_nothrow_invocable VS 2017 15.3 17VS 2017 15.3 17
  N4562 库基础知识:<algorithm> sample()  N4562 Library Fundamentals: <algorithm> sample() VS 2017VS 2017
  N4562 库基础知识:<any>  N4562 Library Fundamentals: <any> VS 2017VS 2017
  N4562 库基础知识:<optional>  N4562 Library Fundamentals: <optional> VS 2017VS 2017
  N4562 库基础知识:<string_view>  N4562 Library Fundamentals: <string_view> VS 2017VS 2017
  N4562 库基础知识:<tuple> apply()  N4562 Library Fundamentals: <tuple> apply() VS 2017VS 2017
  P0032R3 variant/any/optional 的同类接口  P0032R3 Homogeneous Interface For variant/any/optional VS 2017VS 2017
  P0077R2 is_callable、is_nothrow_callable  P0077R2 is_callable, is_nothrow_callable VS 2017VS 2017
  P0088R3 <variant>  P0088R3 <variant> VS 2017VS 2017
  P0163R0 shared_ptr::weak_type  P0163R0 shared_ptr::weak_type VS 2017VS 2017
  P0209R2 make_from_tuple()  P0209R2 make_from_tuple() VS 2017VS 2017
  P0254R2 将 string_view 和 std::string 集成  P0254R2 Integrating string_view And std::string VS 2017VS 2017
  P0307R2 使 Optional 再次大于等于  P0307R2 Making Optional Greater Equal Again VS 2017VS 2017
  P0393R3 使 Variant 大于等于  P0393R3 Making Variant Greater Equal VS 2017VS 2017
  P0504R0 再次访问 in_place_t/in_place_type_t<T>/in_place_index_t<I>  P0504R0 Revisiting in_place_t/in_place_type_t<T>/in_place_index_t<I> VS 2017VS 2017
  P0510R0 拒绝 Nothing、数组、引用和不完整类型的 variant  P0510R0 Rejecting variants Of Nothing, Arrays, References, And Incomplete Types VS 2017VS 2017
  P0025R1 clamp()  P0025R1 clamp() VS 2015.3VS 2015.3
  P0185R1 is_swappable、is_nothrow_swappable  P0185R1 is_swappable, is_nothrow_swappable VS 2015.3VS 2015.3
  P0272R1 非常量 basic_string::data()  P0272R1 Non-const basic_string::data() VS 2015.3VS 2015.3
  N4387 改进 pair 和 tuple  N4387 Improving pair And tuple VS 2015.2 14VS 2015.2 14
  N4508 shared_mutex (Untimed)  N4508 shared_mutex (Untimed) VS 2015.2 14VS 2015.2 14
  P0004R1 删除已弃用的 Iostreams 别名  P0004R1 Removing Deprecated Iostreams Aliases VS 2015.2 remVS 2015.2 rem
  P0006R0 类型特征(is_same_v 等)的变量模板  P0006R0 Variable Templates For Type Traits (is_same_v, etc.) VS 2015.2 14VS 2015.2 14
  P0007R1 as_const()  P0007R1 as_const() VS 2015.2 14VS 2015.2 14
  P0013R1 逻辑运算符类型特征(conjunction 等)  P0013R1 Logical Operator Type Traits (conjunction, etc.) VS 2015.2 14VS 2015.2 14
  P0074R0 owner_less<>  P0074R0 owner_less<> VS 2015.2 14VS 2015.2 14
  P0092R1 <chrono> floor()、ceil()、round()、abs()  P0092R1 <chrono> floor(), ceil(), round(), abs() VS 2015.2 14VS 2015.2 14
  P0156R0 可变参数 lock_guard  P0156R0 Variadic lock_guard VS 2015.2 14VS 2015.2 14
  N3911 void_t  N3911 void_t VS 2015 14VS 2015 14
  N4089 unique_ptr<T[]> 中的安全转换  N4089 Safe Conversions In unique_ptr<T[]> VS 2015 14VS 2015 14
  N4169 invoke()  N4169 invoke() VS 2015 14VS 2015 14
  N4190 删除 auto_ptr、random_shuffle() 和旧的 <功能> 内容  N4190 Removing auto_ptr, random_shuffle(), And Old <functional> Stuff VS 2015 remVS 2015 rem
  N4258 noexcept 清理  N4258 noexcept Cleanups VS 2015 14VS 2015 14
  N4259 uncaught_exceptions()  N4259 uncaught_exceptions() VS 2015 14VS 2015 14
  N4277 可完全复制的 reference_wrapper  N4277 Trivially Copyable reference_wrapper VS 2015 14VS 2015 14
  N4279 map/unordered_map 的 insert_or_assign()/try_emplace()  N4279 insert_or_assign()/try_emplace() For map/unordered_map VS 2015 14VS 2015 14
  N4280 size()、empty()、data()  N4280 size(), empty(), data() VS 2015 14VS 2015 14
  N4366 精确限制 unique_ptr 分配  N4366 Precisely Constraining unique_ptr Assignment VS 2015 14VS 2015 14
  N4389 bool_constant  N4389 bool_constant VS 2015 14VS 2015 14
  P0063R3 C11 标准库  P0063R3 C11 Standard Library VS 2015 C1114VS 2015 C11, 14
  N4510 支持 vector/list/forward_list 中的不完整类型  N4510 Supporting Incomplete Types In vector/list/forward_list VS 2013 14VS 2013 14
C++14 标准库功能C++14 Standard Library Features 支持Supported
  N3462 SFINAE 友好的 result_of  N3462 SFINAE-Friendly result_of VS 2015.2VS 2015.2
  N3302 <complex> 的 constexpr  N3302 constexpr For <complex> VS 2015VS 2015
  N3469 <chrono> 的 constexpr  N3469 constexpr For <chrono> VS 2015VS 2015
  N3470 <数组> 的 constexpr  N3470 constexpr For <array> VS 2015VS 2015
  N3471 <initializer_list>、<tuple> 和 <utility> 的 constexpr  N3471 constexpr For <initializer_list>, <tuple>, <utility> VS 2015VS 2015
  N3545 integral_constant::operator()()  N3545 integral_constant::operator()() VS 2015VS 2015
  N3642 <chrono>、<字符串>(1729ms、“meow”s 等)的 UDL  N3642 UDLs For <chrono>, <string> (1729ms, "meow"s, etc.) VS 2015VS 2015
  N3644 Null 向前迭代器  N3644 Null Forward Iterators VS 2015VS 2015
  N3654 quoted()  N3654 quoted() VS 2015VS 2015
  N3657 异类关联查找  N3657 Heterogeneous Associative Lookup VS 2015VS 2015
  N3658 integer_sequence  N3658 integer_sequence VS 2015VS 2015
  N3659 shared_mutex(定时)  N3659 shared_mutex (Timed) VS 2015VS 2015
  N3668 exchange()  N3668 exchange() VS 2015VS 2015
  N3669 修复不包含常量的 constexpr 成员函数  N3669 Fixing constexpr Member Functions Without const VS 2015VS 2015
  N3670 get<T>()  N3670 get<T>() VS 2015VS 2015
  N3671 Dual-Range equal()、is_permutation()、mismatch()  N3671 Dual-Range equal(), is_permutation(), mismatch() VS 2015VS 2015
  N3778 调整大小的释放  N3778 Sized Deallocation VS 2015VS 2015
  N3779 <complex>(3.14i 等)的 UDL  N3779 UDLs For <complex> (3.14i, etc.) VS 2015VS 2015
  N3789 <功能> 的 constexpr  N3789 constexpr For <functional> VS 2015VS 2015
  N3887 tuple_element_t  N3887 tuple_element_t VS 2015VS 2015
  N3891 将 shared_mutex(定时)重命名为 shared_timed_mutex  N3891 Renaming shared_mutex (Timed) To shared_timed_mutex VS 2015VS 2015
  N3346 容器元素的最低要求  N3346 Minimal Container Element Requirements VS 2013VS 2013
  N3421 透明运算符函子(小于<> 等)  N3421 Transparent Operator Functors (less<>, etc.) VS 2013VS 2013
  N3655 <type_traits>(decay_t 等)的别名模板  N3655 Alias Templates For <type_traits> (decay_t, etc.) VS 2013VS 2013
  N3656 make_unique()  N3656 make_unique() VS 2013VS 2013
  N3924 阻止 rand()  N3924 Discouraging rand() 不可用N/A

一起列出的一组文章表明某项功能已被选择加入到标准版中,同时也选择加入了一篇或多篇改进和扩展该功能的文章。A group of papers listed together indicates that a feature was voted into the Standard, and then one or more papers to improve or expand that feature were also voted in. 这些功能可一起实现。These features are implemented together.

支持的值Supported values

否__表示尚未实现。__No means not yet implemented.
部分支持__意味着尚未在 Visual Studio 2017 中完全实现。__Partial means the implementation in Visual Studio 2017 is incomplete. 有关详细信息,请参阅注释部分。For more details, see the Notes section.
N/A 表示建议文章未介绍功能。N/A means the proposal papers do not describe features. 这些文章虽然更改了标准的语言,但没有为实施者创建任何工作。These papers altered the language of the standard, but didn’t create any work for implementers. 在此处将其列出是出于完整性的考虑。They’re listed here for completeness.
VS 2010 表示在 Visual Studio 2010 中支持的功能。VS 2010 indicates features that are supported in Visual Studio 2010.
VS 2013 表示在 Visual Studio 2013 中支持的功能。VS 2013 indicates features that are supported in Visual Studio 2013.
VS 2015 表示在 Visual Studio 2015 RTM 中支持的功能。VS 2015 indicates features that are supported in Visual Studio 2015 RTM.
VS 2015.2VS 2015.3 分别表示在 Visual Studio 2015 Update 2 和 Visual Studio 2015 Update 3 中支持的功能。VS 2015.2 and VS 2015.3 indicate features that are supported in Visual Studio 2015 Update 2 and Visual Studio 2015 Update 3, respectively.
VS 2017 表示在 Visual Studio 2017 RTM 中支持的功能。VS 2017 indicates features that are supported in Visual Studio 2017 RTM.
VS 2017 15.3__表示 Visual Studio 2017 版本 15.3 中支持的功能。__VS 2017 15.3 indicates features that are supported in Visual Studio 2017 version 15.3.
VS 2017 15.5 表示 Visual Studio 2017 版本 15.5 中支持的功能。VS 2017 15.5 indicates features that are supported in Visual Studio 2017 version 15.5. VS 2017 15.7 表示 Visual Studio 2017 15.7 版中支持的功能。VS 2017 15.7 indicates features that are supported in Visual Studio 2017 version 15.7.


A 在 /std:c++14 模式下,动态异常规范仍处于未实现状态,且 throw() 仍被视为 __ declspec(nothrow) 的同义词。A In /std:c++14 mode, dynamic exception specifications remain unimplemented, and throw() is still treated as a synonym for __declspec(nothrow). 在 C++17 中,动态异常规范大部分被 P0003R5 删除,留下了一个痕迹:throw() 被弃用,并被要求具有 noexcept 的同义词的行为。In C++17, dynamic exception specifications were mostly removed by P0003R5, leaving one vestige: throw() is deprecated and required to behave as a synonym for noexcept. 在 /std:c++17 模式下,MSVC 现通过赋予 throw() 与 noexcept 相同的行为(即通过终止强制执行)来符合标准。In /std:c++17 mode, MSVC now conforms to the Standard by giving throw() the same behavior as noexcept, i.e. enforcement via termination. 编译器选项 /Zc:noexceptTypes- 请求 __declspec(nothrow) 的旧行为。The compiler option /Zc:noexceptTypes- requests our old behavior of __declspec(nothrow). throw() 很可能会从 C++20 删除。It’s likely that throw() will be removed in C++20. 为帮助迁移代码,以响应标准和实现中的这些更改,在 /std:c++17 和 /permissive- 下添加了异常规范问题的新编译器警告。To help with migrating code in response to these changes in the Standard and our implementation, new compiler warnings for exception specification issues have been added under /std:c++17 and /permissive-.
B__支持 Visual Studio 2017 15.7 版中的 /permissive- 模式。__B Supported in /permissive- mode in Visual Studio 2017 version 15.7. 有关详细信息,请参阅 Two-phase name lookup support comes to MSVC(MSVC 引入两阶段名称查找支持)。See Two-phase name lookup support comes to MSVC for more information.
C 自 Visual Studio 2015 Update 2 后,编译器对表达式 SFINAE 的支持足以满足标准库。C The compiler’s support for Expression SFINAE has been sufficient for the Standard Library since Visual Studio 2015 Update 2. 受 Visual Studio 2017 15.7 支持(无论是否设置 /permissive- 模式)。Supported in Visual Studio 2017 15.7 regardless of whether /permissive- mode is set. 某些 bug 仍处于待修复状态。Some bugs remain to be fixed. “唯一标签类型”解决方法不再是必需的,我们已从 STL 实现中将其删除。The “unique tag type” workaround is no longer necessary, and we’ve removed this workaround from our STL implementation.
D 编译器对 C99 预处理器规则的支持在 Visual Studio 2017 中不完整。D The compiler’s support for C99 Preprocessor rules is incomplete in Visual Studio 2017. Variadic 宏受支持,但预处理器的行为存在很多 Bug。Variadic macros are supported, but there are many bugs in the preprocessor’s behavior. 我们正在修改预处理器,并且很快将在 /permissive- 模式下发布实验版的改进内容。We are overhauling the preprocessor, and will experimentally ship those changes under the /permissive- mode soon.
E 它被标记为“不适用”,因为允许但不要求编译器支持扩展的整数类型。E This is marked as Not Applicable because compilers are permitted, but not required, to support extended integer types. 和 GCC 和 Clang 一样,我们选择不支持它们。Like GCC and Clang, we’ve chosen not to support them.
F 与此类似,它被标记为“不适用”,因为允许但不要求编译器实现此优化。F Similarly, this is marked as Not Applicable because compilers are permitted, but not required, to implement this optimization.
G/std:c++14 下受支持,并且出现可禁止的警告。G Supported under /std:c++14 with a suppressible warning.
J 在本表中的其他部分对 Visual Studio 2015 中不完整的功能进行了说明。J Features that were not completed in Visual Studio 2015 are broken out elsewhere in this table.
K 这是一个全新的实现,与之前的 std::experimental 版本不兼容,这对符号链接支持、bug 修复以及更改需符合标准的行为而言是必不可少的。K This is a completely new implementation, incompatible with the previous std::experimental version, necessitated by symlink support, bug fixes, and changes in standard-required behavior. 目前,包含 < filesystem> 提供新 std::filesystem 和旧 std::experimental::filesystem,而包含 <experimental/filesystem> 仅提供旧实验性实现。Currently, including <filesystem> provides the new std::filesystem and the previous std::experimental::filesystem, and including <experimental/filesystem> provides only the old experimental implementation. 在下一突破性 ABI 版本的库中,实验性实现将会被删除。The experimental implementation will be REMOVED in the next ABI-breaking release of the libraries.
L 由编译器内部函数支持。L Supported by a compiler intrinsic.
14 即使指定了 /std:c++14(默认值),这些 C++17/20 功能也始终处于启用状态。14 These C++17/20 features are always enabled, even when /std:c++14 (the default) is specified. 这是因为在引入 /std 选项之前实现了该功能,或者因为条件实现异常复杂。This is either because the feature was implemented before the introduction of the /std options, or because conditional implementation was undesirably complex.
17 这些功能由 /std:c++17(或 /std:c++latest)编译器选项启用。17 These features are enabled by the /std:c++17 (or /std:c++latest) compiler option.
byte std::byte/std:c++17(或 /std:c++latest)启用,但由于它在某些情况下可能会与 Windows SDK 标头冲突,因此它具有细化的选择退出宏。byte std::byte is enabled by /std:c++17 (or /std:c++latest), but because it can conflict with the Windows SDK headers in some cases, it has a fine-grained opt-out macro. 可以通过将 _HAS_STD_BYTE 定义为 0 将其禁用。It can be disabled by defining _HAS_STD_BYTE as 0.
C11 通用 CRT 实现了 C++17 所需的部分 C11 标准库,不包括 C99 strftime() E/O 备用转换说明符、C11 fopen() 独占模式和 C11 aligned_alloc()C11 The Universal CRT implemented the parts of the C11 Standard Library that are required by C++17, with the exception of C99 strftime() E/O alternative conversion specifiers, C11 fopen() exclusive mode, and C11 aligned_alloc(). 后者不太可能实现,因为 C11 以与 free() 的 Microsoft 实现不兼容的方式指定了 aligned_alloc(),即 free() 必须能够处理高度一致的分配。The latter is unlikely to be implemented, because C11 specified aligned_alloc() in a way that's incompatible with the Microsoft implementation of free(), namely, that free() must be able to handle highly aligned allocations.
指定 /std:c++17(或 /std:c++latest)编译器选项后会删除 rem 功能。rem Features removed when the /std:c++17 (or /std:c++latest) compiler option is specified. 这些功能具有选择退出宏:_HAS_AUTO_PTR_ETC_HAS_FUNCTION_ALLOCATOR_SUPPORT_HAS_OLD_IOSTREAMS_MEMBERS_HAS_UNEXPECTEDThese features have opt-out macros: _HAS_AUTO_PTR_ETC, _HAS_FUNCTION_ALLOCATOR_SUPPORT, _HAS_OLD_IOSTREAMS_MEMBERS, and _HAS_UNEXPECTED.
charconv from_chars() 和 to_chars() 均可用于整数。charconv from_chars() and to_chars() are available for integers. 我们目前正在处理浮点 from_chars(),其后需接浮点 to_chars()。We’re currently working on floating-point from_chars(), to be followed by floating-point to_chars().
并行 C++17 的并行算法库已完成。parallel C++17’s parallel algorithms library is complete. 请注意,这并不意味着各种情况中的各种算法都是并行执行的;我们已将最重要的算法并行执行,且即使算法未并行执行,我们也提供执行策略签名。Note that this doesn’t mean every algorithm is parallelized in every case; the most important algorithms have been parallelized and execution policy signatures are provided even where algorithms are not parallelized. 我们的 STL 实现的中心内部标头 yvals.h 中包含以下“并行算法注释”:C++ 允许实现将并行算法作为系列算法的调用实现。Our STL implementation’s central internal header, yvals.h, contains the following “Parallel Algorithms Notes”: C++ allows an implementation to implement parallel algorithms as calls to the serial algorithms. 此实现并行执行几个常见算法调用,但不是全部。This implementation parallelizes several common algorithm calls, but not all.

以下算法并行执行:The following algorithms are parallelized:

  • adjacent_difference、adjacent_find、all_of、any_of、count、count_if、equal、exclusive_scan、find、find_end、find_first_of、find_if、for_each、for_each_n、inclusive_scan、mismatch、none_of、reduce、remove、remove_if、search、search_n、sort、stable_sort、transform、transform_exclusive_scan、transform_inclusive_scan、transform_reduce。adjacent_difference, adjacent_find, all_of, any_of, count, count_if, equal, exclusive_scan, find, find_end, find_first_of, find_if, for_each, for_each_n, inclusive_scan, mismatch, none_of, reduce, remove, remove_if, search, search_n, sort, stable_sort, transform, transform_exclusive_scan, transform_inclusive_scan, transform_reduce.

以下算法目前不并行执行:The following are not presently parallelized:

  • 目标硬件上的并行性能没有显著提升;只用于复制或交换无分支的元素的所有算法通常会受内存带宽限制:No apparent parallelism performance improvement on target hardware; all algorithms which merely copy or permute elements with no branches are typically memory bandwidth limited:
    • copy、copy_backward、copy_n、fill、fill_n、move、move_backward、remove、remove_if、replace、replace_if、reverse、reverse_copy、rotate、rotate_copy、swap_rangescopy, copy_backward, copy_n, fill, fill_n, move, move_backward, remove, remove_if, replace, replace_if, reverse, reverse_copy, rotate, rotate_copy, swap_ranges
  • 对用户并行性要求存在混淆;可能出现在上述类别中:Confusion over user parallelism requirements exists; likely in the above category anyway:
    • generate、generate_ngenerate, generate_n
  • 疑为不可实现的有效并行性:Effective parallelism suspected to be infeasible:
    • partial_sort、partial_sort_copypartial_sort, partial_sort_copy
  • 尚未评估;并行性可能在未来的版本中实现,且可能是有益的:Not yet evaluated; parallelism may be implemented in a future release and is suspected to be beneficial:
    • copy_if、includes、inplace_merge、is_heap、is_heap_until、is_partitioned、is_sorted、is_sorted_until、lexicographical_compare、max_element、merge、min_element、minmax_element、nth_element、partition_copy、remove_copy、remove_copy_if、replace_copy、replace_copy_if、set_difference、set_intersection、set_symmetric_difference、set_union、stable_partition、unique、unique_copycopy_if, includes, inplace_merge, is_heap, is_heap_until, is_partitioned, is_sorted, is_sorted_until, lexicographical_compare, max_element, merge, min_element, minmax_element, nth_element, partition_copy, remove_copy, remove_copy_if, replace_copy, replace_copy_if, set_difference, set_intersection, set_symmetric_difference, set_union, stable_partition, unique, unique_copy

请参阅See also

C++ 语言参考C++ Language Reference
C++ 标准库C++ Standard Library
Visual Studio 2017 中 C++ 的符合性改进C++ conformance improvements in Visual Studio 2017
Visual Studio 2017 中 Visual C++ 的新增功能What's New for Visual C++ in Visual Studio 2017
Visual C++ 更改历史记录(2003 - 2015)Visual C++ change history 2003 through 2015
Visual C++ 新增功能(2003 - 2015)Visual C++ What's New 2003 through 2015
Visual C++ 团队博客Visual C++ team blog