Language features:

Templates and Generic Code

Lambda

constexpr lambdas Lambdas are implicitly constexpr if they qualify

Capturing *this in lambdas [*this]{ std::cout << could << " be " << useful << '

'; }



Attributes

Syntax cleanup

Cleaner multi-return and flow control

Structured bindings Basically, first-class std::tie with auto Example: const auto [it, inserted] = map.insert( {"foo", bar} ); Creates variables it and inserted with deduced type from the pair that map::insert returns. Works with tuple/pair-likes & std::array s and relatively flat structs Actually named structured bindings in standard

if (init; condition) and switch (init; condition) if (const auto [it, inserted] = map.insert( {"foo", bar} ); inserted) Extends the if(decl) to cases where decl isn't convertible-to-bool sensibly.

Generalizing range-based for loops Appears to be mostly support for sentinels, or end iterators that are not the same type as begin iterators, which helps with null-terminated loops and the like.

if constexpr Much requested feature to simplify almost-generic code.



Misc

Library additions:

Data types

std::variant<Ts...> Almost-always non-empty last I checked? Tagged union type {awesome|useful}

std::optional Maybe holds one of something Ridiculously useful

std::any Holds one of anything (that is copyable)

std::string_view std::string like reference-to-character-array or substring Never take a string const& again. Also can make parsing a bajillion times faster. "hello world"sv constexpr char_traits

std::byte off more than they could chew. Neither an integer nor a character, just data



Invoke stuff

std::invoke Call any callable (function pointer, function, member pointer) with one syntax. From the standard INVOKE concept.

std::apply Takes a function-like and a tuple, and unpacks the tuple into the call.

std::make_from_tuple , std::apply applied to object construction

is_invocable , is_invocable_r , invoke_result http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0077r2.html http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0604r0.html Deprecates result_of is_invocable<Foo(Args...), R> is "can you call Foo with Args... and get something compatible with R ", where R=void is default. invoke_result<Foo, Args...> is std::result_of_t<Foo(Args...)> but apparently less confusing?



for_each_n

reduce

transform_reduce

exclusive_scan

inclusive_scan

transform_exclusive_scan

transform_inclusive_scan

Added for threading purposes, exposed even if you aren't using them threaded

Threading

std::shared_mutex Untimed, which can be more efficient if you don't need it.

atomic<T> ::is_always_lockfree

scoped_lock<Mutexes...> Saves some std::lock pain when locking more than one mutex at a time.

Parallelism TS v1 The linked paper from 2014, may be out of date Parallel versions of std algorithms, and related machinery

hardware_*_interference_size

(parts of) Library Fundamentals TS v1 not covered above or below

Container Improvements

Smart pointer changes

unique_ptr<T[]> fixes and other unique_ptr tweaks.

fixes and other tweaks. weak_from_this and some fixed to shared from this

Other std datatype improvements:

Misc

Traits

Deprecated

Isocpp.org has has an independent list of changes since C++14; it has been partly pillaged.

Naturally TS work continues in parallel, so there are some TS that are not-quite-ripe that will have to wait for the next iteration. The target for the next iteration is C++20 as previously planned, not C++19 as some rumors implied. C++1O has been avoided.

Initial list taken from this reddit post and this reddit post, with links added via googling or from the above isocpp.org page.

Additional entries pillaged from SD-6 feature-test list.

clang's feature list and library feature list are next to be pillaged. This doesn't seem to be reliable, as it is C++1z, not C++17.

these slides had some features missing elsewhere.

While "what was removed" was not asked, here is a short list of a few things ((mostly?) previous deprecated) that are removed in C++17 from C++:

Removed:

There were rewordings. I am unsure if these have any impact on code, or if they are just cleanups in the standard:

Papers not yet integrated into above:

P0505R0 (constexpr chrono)

P0418R2 (atomic tweaks)

P0512R0 (template argument deduction tweaks)

P0490R0 (structured binding tweaks)

P0513R0 (changes to std::hash )

P0502R0 (parallel exceptions)

P0509R1 (updating restrictions on exception handling)

P0012R1 (make exception specifications be part of the type system)

P0510R0 (restrictions on variants)

P0504R0 (tags for optional/variant/any)

P0497R0 (shared ptr tweaks)

P0508R0 (structured bindings node handles)

P0521R0 (shared pointer use count and unique changes?)

Spec changes:

Further reference: