β

C++17 Progress in VS 2017 15.5 and 15.6

Visual C++ Team Blog 18 阅读

VS 2017 15.5 is now available for production use, and 15.6 Preview 1 is also available . As usual, here are feature tables for the STL and compiler, plus a detailed list of STL improvements. (You can also read our previous changelog for VS 2017 15.3.) Please note that due to our branch structure and merge timing, features and fixes described below as being in VS 2017 15.6 have been checked in and will be available by the time that it’s ready for production use, but 15.6 Preview 1 contains only a subset of those features and fixes.

STL Feature Status:

Status

Std

Paper

Title

Notes

missing

C++17

P0067R5

Elementary String Conversions

patch

C++17

P0682R1

Repairing Elementary String Conversions

[DR]

missing

C++17

P0030R1

hypot(x, y, z)

missing

C++17

P0226R1

Mathematical Special Functions

Partial

C++17

P0024R2

Parallel Algorithms

[parallel]

patch

C++17

P0336R1

Renaming Parallel Execution Policies

patch

C++17

P0394R4

Parallel Algorithms Should terminate() For Exceptions

patch

C++17

P0452R1

Unifying <numeric> Parallel Algorithms

patch

C++17

P0467R2

Requiring Forward Iterators In Parallel Algorithms

patch

C++17

P0502R0

Parallel Algorithms Should terminate() For Exceptions, Usually

patch

C++17

P0518R1

Copying Trivially Copy Constructible Elements In Parallel Algorithms

patch

C++17

P0523R1

Relaxing Complexity Requirements Of Parallel Algorithms (General)

patch

C++17

P0574R1

Relaxing Complexity Requirements Of Parallel Algorithms (Specific)

patch

C++17

P0623R0

Final C++17 Parallel Algorithms Fixes

missing

C++17

P0218R1

<filesystem>

patch

C++17

P0219R1

Relative Paths For Filesystem

patch

C++17

P0317R1

Directory Entry Caching For Filesystem

patch

C++17

P0392R0

Supporting string_view In Filesystem Paths

patch

C++17

P0430R2

Supporting Non-POSIX Filesystems

patch

C++17

P0492R2

Resolving NB Comments For Filesystem

VS 2017 15.x

C++20

P0777R1

Avoiding Unnecessary decay

[decay] [14]

VS 2017 15.6

C++17

<memory_resource>

VS 2017 15.6

C++17

P0220R1

Library Fundamentals V1

VS 2017 15.6

C++17

P0337R0

Deleting polymorphic_allocator Assignment

Partial 15.6

C++17

P0426R1

constexpr For char_traits

[char_traits]

Partial 15.6

C++17

P0433R2

Deduction Guides For The STL

[guides]

VS 2017 15.6

C++17

P0739R0

Improving Class Template Argument Deduction For The STL

[DR]

VS 2017 15.5

C++17

P0003R5

Removing Dynamic Exception Specifications

[rem]

VS 2017 15.5

C++17

P0005R4

not_fn()

[depr]

VS 2017 15.5

C++17

P0033R1

Rewording enable_shared_from_this

[14]

VS 2017 15.5

C++17

P0083R3

Splicing Maps And Sets

VS 2017 15.5

C++17

P0174R2

Deprecating Vestigial Library Parts

[depr]

VS 2017 15.5

C++17

P0302R1

Removing Allocator Support In std::function

[rem]

VS 2017 15.5

C++17

P0358R1

Fixes For not_fn()

VS 2017 15.5

C++17

P0414R2

shared_ptr<T[]>, shared_ptr<T[N]>

[14]

VS 2017 15.5

C++17

P0497R0

Fixing shared_ptr For Arrays

[14]

VS 2017 15.5

C++17

P0508R0

Clarifying insert_return_type

VS 2017 15.5

C++17

P0521R0

Deprecating shared_ptr::unique()

[depr]

VS 2017 15.5

C++17

P0607R0

Inline Variables For The STL

VS 2017 15.5

C++17

P0618R0

Deprecating <codecvt>

[depr]

VS 2017 15.3

C++17

Boyer-Moore search()

VS 2017 15.3

C++17

P0031R0

constexpr For <array> (Again) And <iterator>

VS 2017 15.3

C++17

P0040R3

Extending Memory Management Tools

VS 2017 15.3

C++17

P0084R2

Emplace Return Type

VS 2017 15.3

C++17

P0152R1

atomic::is_always_lock_free

VS 2017 15.3

C++17

P0154R1

hardware_destructive_interference_size, etc.

VS 2017 15.3

C++17

P0156R2

scoped_lock

VS 2017 15.3

C++17

P0253R1

Fixing Searcher Return Types

VS 2017 15.3

C++17

P0258R2

has_unique_object_representations

[obj_rep]

VS 2017 15.3

C++17

P0295R0

gcd(), lcm()

VS 2017 15.3

C++17

P0298R3

std::byte

[byte]

VS 2017 15.3

C++17

P0403R1

UDLs For <string_view> (“meow”sv, etc.)

VS 2017 15.3

C++17

P0418R2

atomic compare_exchange memory_order Requirements

[14]

VS 2017 15.3

C++17

P0435R1

Overhauling common_type

[14]

VS 2017 15.3

C++17

P0505R0

constexpr For <chrono> (Again)

VS 2017 15.3

C++17

P0513R0

Poisoning hash

[14]

VS 2017 15.3

C++17

P0516R0

Marking shared_future Copying As noexcept

[14]

VS 2017 15.3

C++17

P0517R0

Constructing future_error From future_errc

[14]

VS 2017 15.3

C++17

P0548R1

Tweaking common_type And duration

[14]

VS 2017 15.3

C++17

P0558R1

Resolving atomic<T> Named Base Class Inconsistencies

[atomic] [14]

VS 2017 15.3

C++17

P0599R1

noexcept hash

[14]

VS 2017 15.3

C++17

P0604R0

invoke_result, is_invocable, is_nothrow_invocable

[depr]

VS 2017

C++17

<algorithm> sample()

VS 2017

C++17

<any>

VS 2017

C++17

<optional>

VS 2017

C++17

<string_view>

VS 2017

C++17

<tuple> apply()

VS 2017

C++17

P0032R3

Homogeneous Interface For variant/any/optional

VS 2017

C++17

P0077R2

is_callable, is_nothrow_callable

VS 2017

C++17

P0088R3

<variant>

VS 2017

C++17

P0163R0

shared_ptr::weak_type

VS 2017

C++17

P0209R2

make_from_tuple()

VS 2017

C++17

P0254R2

Integrating string_view And std::string

VS 2017

C++17

P0307R2

Making Optional Greater Equal Again

VS 2017

C++17

P0393R3

Making Variant Greater Equal

VS 2017

C++17

P0504R0

Revisiting in_place_t/in_place_type_t<T>/in_place_index_t<I>

VS 2017

C++17

P0510R0

Rejecting variants Of Nothing, Arrays, References, And Incomplete Types

VS 2015.3

C++17

P0025R1

clamp()

VS 2015.3

C++17

P0185R1

is_swappable, is_nothrow_swappable

VS 2015.3

C++17

P0272R1

Non-const basic_string::data()

VS 2015.2

C++17

N4387

Improving pair And tuple

[14]

VS 2015.2

C++17

N4508

shared_mutex (Untimed)

[14]

VS 2015.2

C++17

P0004R1

Removing Deprecated Iostreams Aliases

[rem]

VS 2015.2

C++17

P0006R0

Variable Templates For Type Traits (is_same_v, etc.)

[14]

VS 2015.2

C++17

P0007R1

as_const()

[14]

VS 2015.2

C++17

P0013R1

Logical Operator Type Traits (conjunction, etc.)

[14]

VS 2015.2

C++17

P0074R0

owner_less<>

[14]

VS 2015.2

C++17

P0092R1

<chrono> floor(), ceil(), round(), abs()

[14]

VS 2015.2

C++17

P0156R0

Variadic lock_guard

[14]

VS 2015

C++17

N3911

void_t

[14]

VS 2015

C++17

N4089

Safe Conversions In unique_ptr<T[]>

[14]

VS 2015

C++17

N4169

invoke()

[14]

VS 2015

C++17

N4190

Removing auto_ptr, random_shuffle(), And Old <functional> Stuff

[rem]

VS 2015

C++17

N4258

noexcept Cleanups

[14]

VS 2015

C++17

N4259

uncaught_exceptions()

[14]

VS 2015

C++17

N4277

Trivially Copyable reference_wrapper

[14]

VS 2015

C++17

N4279

insert_or_assign()/try_emplace() For map/unordered_map

[14]

VS 2015

C++17

N4280

size(), empty(), data()

[14]

VS 2015

C++17

N4366

Precisely Constraining unique_ptr Assignment

[14]

VS 2015

C++17

N4389

bool_constant

[14]

VS 2015

C++17

P0063R3

C11 Standard Library

[C11] [14]

VS 2013

C++17

N4510

Supporting Incomplete Types In vector/list/forward_list

[14]

Here are the parallel algorithms that we’ve implemented:

Compiler Feature Status:

C++03/11/14 Core Language Features

Status

Paper

Notes

[Everything else]

VS 2017

[throw()]

Two-phase name lookup

Partial

[twoPhase]

Expression SFINAE

Partial

N2634

[exprSFINAE]

C99 preprocessor

Partial

N1653

[preprocessor]

C++17 Core Language Features

Status

Paper

Notes

Removing trigraphs

VS 2010

N4086

[14]

New rules for auto with braced-init-lists

VS 2015

N3922

[14]

typename in template template-parameters

VS 2015

N4051

[14]

Attributes for namespaces and enumerators

VS 2015

N4266

[14]

u8 character literals

VS 2015

N4267

[14]

Ignoring unrecognized attributes

VS 2015

P0283R2

[14]

Nested namespace definitions

VS 2015.3

N4230

Terse static_assert

VS 2017

N3928

Generalized range-based for-loops

VS 2017

P0184R0

[14]

[[fallthrough]] attribute

VS 2017

P0188R1

Removing the register keyword

VS 2017 15.3

P0001R1

Removing operator++ for bool

VS 2017 15.3

P0002R1

Capturing *this by value

VS 2017 15.3

P0018R3

Using attribute namespaces without repetition

VS 2017 15.3

P0028R4

__has_include

VS 2017 15.3

P0061R1

[14]

Direct-list-init of fixed enums from integers

VS 2017 15.3

P0138R2

constexpr lambdas

VS 2017 15.3

P0170R1

[[nodiscard]] attribute

VS 2017 15.3

P0189R1

[[maybe_unused]] attribute

VS 2017 15.3

P0212R1

Structured bindings

VS 2017 15.3

P0217R3

constexpr if-statements

VS 2017 15.3

P0292R2

[ifConstexpr]

Selection statements with initializers

VS 2017 15.3

P0305R1

Allowing more non-type template args

VS 2017 15.5

N4268

Fold expressions

VS 2017 15.5

N4295

and P0036R0

Removing dynamic-exception-specifications

VS 2017 15.5

P0003R5

Adding noexcept to the type system

VS 2017 15.5

P0012R1

Over-aligned dynamic memory allocation

VS 2017 15.5

P0035R4

Hexfloat literals

VS 2017 15.5

P0245R1

Inline variables

VS 2017 15.5

P0386R2

Matching template template-parameters to compatible arguments

VS 2017 15.5

P0522R0

Guaranteed copy elision

VS 2017 15.6

P0135R1

Fixing qualification conversions

No

N4261

Extended aggregate initialization

No

P0017R1

Class template argument deduction

No

P0091R3

and P0512R0

Declaring non-type template parameters with auto

No

P0127R2

Rewording inheriting constructors

No

P0136R1

std::launder()

No

P0137R1

[launder]

Refining expression evaluation order

No

P0145R3

and P0400R0

Pack expansions in using-declarations

No

P0195R2

Simplifying implicit lambda capture

No

P0588R1

[DR]

Fixing class template argument deduction for initializer-list ctors

No

P0702R1

[DR]

CWG 1581: When are constexpr member functions defined?

No

P0859R0

[DR]

STL Fixes:

The following fixes are available in VS 2017 15.5, unless otherwise specified as appearing in VS 2017 15.6.

Significant Changes:

New Warnings And Errors:

Correctness Fixes:

Performance/Throughput Fixes:

Readability And Other Improvements:

C++20:

We’re working on finishing C++17 before starting C++20. For completeness, here are the rest of the papers that have been voted into the C++20 Working Paper. (While we’ve added many [[nodiscard]] attributes to our codebase, P0600R1 is not yet complete.)

Status

Std

Paper

Title

Notes

missing

C++20

P0020R6

atomic<float>, atomic<double>, atomic<long double>

missing

C++20

P0053R7

<syncstream>

missing

C++20

P0202R3

constexpr For <algorithm> And exchange()

missing

C++20

P0415R1

constexpr For <complex> (Again)

missing

C++20

P0439R0

enum class memory_order

missing

C++20

P0457R2

starts_with()/ends_with() For basic_string/basic_string_view

missing

C++20

P0463R1

endian

missing

C++20

P0550R2

remove_cvref

missing

C++20

P0600R1

[[nodiscard]] For The STL, Part 1

[nodiscard]

missing

C++20

P0616R0

Using move() In <numeric>

missing

C++20

P0653R2

to_address()

missing

C++20

P0674R1

make_shared() For Arrays

missing

C++20

P0718R2

atomic<shared_ptr<T>>, atomic<weak_ptr<T>>

[depr]

missing

C++20

P0767R1

Deprecating is_pod

[depr]

missing

C++20

P0768R1

Library Support For The Spaceship Comparison Operator <=>

[depr]

C++20 Core Language Features

Status

Paper

Notes

Adding __VA_OPT__ for comma omission and comma deletion

No

P0306R4

Allowing lambdas in unevaluated contexts

No

P0315R4

Designated initialization

No

P0329R4

Allowing lambda-capture [=, this]

No

P0409R2

Familiar template syntax for generic lambdas

No

P0428R2

Three-way (spaceship) comparison operator <=>

No

P0515R3

Range-based for-loops with initializers

No

P0614R1

Default constructible and assignable stateless lambdas

No

P0624R2

CWG 1331: const mismatch with defaulted copy constructor

No

P0641R2

Default member initializers for bit-fields

No

P0683R1

Relaxing access checking on specializations

No

P0692R1

Fixing const lvalue ref-qualified pointers to members

No

P0704R1

Concepts

No

P0734R0

ADL and function templates that are not visible

No

P0846R0

Fixing functionality gaps in constraints

No

P0857R0

Reporting Bugs:

Please let us know what you think about VS 2017 15.5 and 15.6. You can report bugs via the IDE’s Report A Problem and also via the web: go to the VS Developer Community and click on the C++ tab. For compiler and library bugs, it’s important to provide self-contained test cases.

Happy holidays from your C++ Standard Library implementers (and the rest of the Visual C++ team!):

作者:Visual C++ Team Blog
All things Visual C++!
原文地址:C++17 Progress in VS 2017 15.5 and 15.6, 感谢原作者分享。

发表评论