# C++17

**C++17** is a major revision of the ISO C++ programming language standard, formally [ISO/IEC 14882](https://www.edgepedia.org/iso-iec-14882):2017, published in December 2017. It follows the minor revision C++14 and introduces new language and library features, including structured bindings, fold expressions, `if constexpr`, class template argument deduction, and the `std::optional`, `std::variant`, `std::any`, and `std::string_view` utility types.<sup>[1](https://en.cppreference.com/cpp/17)</sup><sup> • </sup><sup>[2](https://isocpp.org/files/papers/n4713.pdf)</sup>

| Key fact | Detail |
|---|---|
| Formal designation | ISO/IEC 14882:2017, *Programming Languages — C++*<sup>[2](https://isocpp.org/files/papers/n4713.pdf)</sup> |
| Publication | December 2017, following the minor C++14 revision<sup>[1](https://en.cppreference.com/cpp/17)</sup> |
| Merged technical specifications | File System TS (`<filesystem>`), Library fundamentals v1 (`std::any`, `std::optional`, `std::string_view`, polymorphic allocators), Library fundamentals v2 (`std::void_t`, `std::gcd`, `std::lcm`), Parallelism v1 (execution policies, `std::reduce`)<sup>[1](https://en.cppreference.com/cpp/17)</sup> |
| New headers | `<any>`, `<charconv>`, `<execution>`, `<filesystem>`, `<memory_resource>`, `<optional>`, `<string_view>`, `<variant>`<sup>[1](https://en.cppreference.com/cpp/17)</sup> |
| Removed features | `std::auto_ptr`, `std::random_shuffle`, trigraphs, the `register` keyword, dynamic exception specification, `bool` increment<sup>[1](https://en.cppreference.com/cpp/17)</sup> |
| Compiler support | Clang 5 and later implement all C++17 language features; GCC has substantially complete support; MSVC enables C++17 with `/std:c++17` from Visual Studio 2017 version 15.3<sup>[3](https://clang.llvm.org/cxx_status)</sup><sup> • </sup><sup>[4](https://gcc.gnu.org/onlinedocs/gcc/Standards.html)</sup><sup> • </sup><sup>[5](https://learn.microsoft.com/en-gb/cpp/build/reference/std-specify-language-standard-version?view=msvc-170)</sup> |

## Standardization timeline

The C++17 working draft N4659, edited by Richard Smith of Google, was dated 21 March 2017, and N4660 was the C++17 Draft International Standard ballot document of the same date.<sup>[6](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4661.html)</sup> The final standard was published by ISO in December 2017.<sup>[1](https://en.cppreference.com/cpp/17)</sup> Much of its content came from technical specifications (TS) that the committee had developed separately and voted to merge: the File System TS became the `<filesystem>` library, the Library fundamentals TSs supplied the vocabulary types and metafunction helpers, and the Parallelism TS supplied parallel algorithms.<sup>[1](https://en.cppreference.com/cpp/17)</sup>

## Language features

**Compile-time programming.** `if constexpr` makes the condition of an `if` statement a constant expression; when the condition is false, the first substatement becomes a discarded statement that is not instantiated during template instantiation, which allows a single template to replace pairs of overloads selected by tag dispatch.<sup>[7](https://www.eel.is/c++draft/stmt.if)</sup> Lambda expressions may be `constexpr`, and non-type template parameters can be declared with `auto`, letting the compiler deduce the parameter's type from its value.<sup>[1](https://en.cppreference.com/cpp/17)</sup><sup> • </sup><sup>[8](https://learn.microsoft.com/en-gb/cpp/overview/cpp-conformance-improvements-2017?view=msvc-160)</sup>

**Fold expressions.** A fold expression performs a fold of a parameter pack over a binary operator, with unary left and right forms such as `(... op e)` and `(e op ...)`, and binary forms such as `(e1 op1 ... op2 e2)`. In a binary fold the two operators must be the same, and exactly one operand may contain an unexpanded pack.<sup>[9](https://eel.is/c++draft/expr.prim.fold)</sup> Folding an empty pack is allowed only for three operators: `&&` yields `true`, `||` yields `false`, and the comma operator yields `void()`; any other operator makes the instantiation ill-formed.<sup>[10](https://eel.is/c++draft/temp.variadic)</sup>

**Declarations and initialization.** Structured bindings introduce several names at once from an array, a class with public data members, or a tuple-like object, as in `auto [x, y] = f();` where `f` returns a two-element array.<sup>[11](https://eel.is/c++draft/dcl.struct.bind)</sup> Class template argument deduction lets a constructor deduce template arguments, so `tuple t(4, 3, 2.5)` needs no explicit template argument list.<sup>[1](https://en.cppreference.com/cpp/17)</sup> Other changes include inline variables, initializers for `if` and `switch`, guaranteed copy elision, temporary materialization, simplified nested namespaces, lambda capture of `*this`, `u8` character literals, `noexcept` as part of the type system, new rules for the order of evaluation of subexpressions, the attributes `[[fallthrough]]`, `[[maybe_unused]]`, and `[[nodiscard]]`, and the `__has_include` preprocessor conditional.<sup>[1](https://en.cppreference.com/cpp/17)</sup>

## Library features

**Vocabulary types.** `std::optional` holds a contained object of an optional value or an empty state; `std::variant` is a discriminated union whose contained value's type must be one of its template argument types; `std::any` stores an instance of any type meeting its constructor requirements, with the non-member `any_cast` functions providing type-safe access.<sup>[12](https://eel.is/c++draft/optional)</sup><sup> • </sup><sup>[13](https://eel.is/c++draft/variant.general)</sup><sup> • </sup><sup>[14](https://eel.is/c++draft/any.class.general)</sup> `std::string_view` is a non-owning read-only view over a character sequence, with implicit conversions from `const charT*` and `std::basic_string` so that functions can accept a `string_view` parameter wherever a character sequence is expected; its member functions run in O(1) time unless otherwise specified, and the type is trivially copyable.<sup>[15](https://eel.is/c++draft/string.view)</sup>

**Filesystem.** The `std::filesystem` library, in namespace `std::filesystem`, describes operations on file systems and their components such as paths, regular files, and directories. It provides the `path` class, directory and recursive directory iterators, file status queries such as `is_directory` and `file_size`, and operations such as `copy`, `rename`, `create_directories`, and `remove_all`, with POSIX conformance requirements and overloads taking an `error_code` for non-throwing use.<sup>[16](https://eel.is/c++draft/filesystems)</sup>

**Parallel algorithms.** Parallel algorithms are overloads of standard algorithms with an additional first parameter of execution-policy type. The policies are `std::execution::seq`, `par`, `par_unseq`, and `unseq`; an implementation may fall back to sequential execution if it cannot parallelize an invocation, for example for lack of resources.<sup>[17](https://www.eel.is/c++draft/algorithms.parallel)</sup><sup> • </sup><sup>[18](https://eel.is/c++draft/algorithms.parallel.overloads)</sup> Related additions include `std::reduce`, `std::inclusive_scan`, and `std::exclusive_scan`.<sup>[1](https://en.cppreference.com/cpp/17)</sup>

**Other additions.** The library gained `std::byte`, the type traits `std::conjunction`, `std::disjunction`, and `std::negation`, `std::invoke`, `std::clamp`, `std::gcd` and `std::lcm`, map and set `extract` and `merge`, `try_emplace` and `insert_or_assign` for maps, the non-member `std::size`, `std::empty`, and `std::data`, `std::scoped_lock`, `std::to_chars` and `std::from_chars` in the new `<charconv>` header, polymorphic allocators in `<memory_resource>`, mathematical special functions, and a three-argument `std::hypot`.<sup>[1](https://en.cppreference.com/cpp/17)</sup>

## Removals and deprecations

C++17 removed `std::auto_ptr`, deprecated function objects, `std::random_shuffle`, `std::unexpected`, the obsolete `iostreams` aliases, trigraphs, the `register` keyword, `bool` increment, and dynamic exception specifications.<sup>[1](https://en.cppreference.com/cpp/17)</sup> It deprecated `std::iterator`, `std::raw_storage_iterator`, `std::get_temporary_buffer`, `std::is_literal_type`, `std::result_of`, and the whole `<codecvt>` header.<sup>[1](https://en.cppreference.com/cpp/17)</sup>

## Compiler support

Clang 5 and later implement all the features of the ISO C++ 2017 standard, selected with `-std=c++17` (or `-std=c++1z` in Clang 4 and earlier); from Clang 16 onward, C++17 is the default.<sup>[3](https://clang.llvm.org/cxx_status)</sup> GCC has substantially complete support for the standard, selectable with `-std=c++17` or, with GNU extensions, `-std=gnu++17`.<sup>[4](https://gcc.gnu.org/onlinedocs/gcc/Standards.html)</sup> In Visual Studio, the `/std:c++17` option, available starting with [Visual Studio](https://www.edgepedia.org/visual-studio) 2017 version 15.3, enables the full set of C++17 features implemented by the MSVC compiler and disables post-C++17 changes while keeping retroactive defect updates. Several C++17 features, such as the new `auto` rules for braced-init-lists, removal of trigraphs, and `u8` character literals, remain enabled even under `/std:c++14` to avoid breaking code that already depended on them.<sup>[5](https://learn.microsoft.com/en-gb/cpp/build/reference/std-specify-language-standard-version?view=msvc-170)</sup>

## Later developments

C++20 superseded C++17 as the next major revision.

## References

1. [C++17, cppreference.com](https://en.cppreference.com/cpp/17)
2. [Cross references from ISO C++ 2017 (N4713), isocpp.org](https://isocpp.org/files/papers/n4713.pdf)
3. [Clang - C++ Programming Language Status, LLVM](https://clang.llvm.org/cxx_status)
4. [Standards, Using the GNU Compiler Collection (GCC)](https://gcc.gnu.org/onlinedocs/gcc/Standards.html)
5. [/std (Specify Language Standard Version), Microsoft Learn](https://learn.microsoft.com/en-gb/cpp/build/reference/std-specify-language-standard-version?view=msvc-170)
6. [N4661: Editors' Report -- Programming Languages -- C++, open-std.org](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4661.html)
7. [stmt.if, C++ standard draft, eel.is](https://www.eel.is/c++draft/stmt.if)
8. [C++ conformance improvements in Visual Studio 2017, Microsoft Learn](https://learn.microsoft.com/en-gb/cpp/overview/cpp-conformance-improvements-2017?view=msvc-160)
9. [expr.prim.fold, C++ standard draft, eel.is](https://eel.is/c++draft/expr.prim.fold)
10. [temp.variadic, C++ standard draft, eel.is](https://eel.is/c++draft/temp.variadic)
11. [dcl.struct.bind, C++ standard draft, eel.is](https://eel.is/c++draft/dcl.struct.bind)
12. [optional, C++ standard draft, eel.is](https://eel.is/c++draft/optional)
13. [variant.general, C++ standard draft, eel.is](https://eel.is/c++draft/variant.general)
14. [any.class.general, C++ standard draft, eel.is](https://eel.is/c++draft/any.class.general)
15. [string.view, C++ standard draft, eel.is](https://eel.is/c++draft/string.view)
16. [filesystems, C++ standard draft, eel.is](https://eel.is/c++draft/filesystems)
17. [algorithms.parallel, C++ standard draft, eel.is](https://www.eel.is/c++draft/algorithms.parallel)
18. [algorithms.parallel.overloads, C++ standard draft, eel.is](https://eel.is/c++draft/algorithms.parallel.overloads)

---
*Topic: Encyclopedia › Technology and the built world › Computing and digital systems › Software and programming › Programming languages › Individual programming languages › C-family and imperative languages*

*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 19, 2026; Oct 15, 2026 · Edited: Sep 19, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

*Copyright 2026 EdgeChat AI, a subsidiary of Biostate AI.*

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license
