c++17 · iso/iec 14882:2017
structured bindings, if constexpr, std::optional/variant/string_view, parallel algorithms, class template argument deduction — и десяток более мелких, но постоянно используемых улучшений. 18 фич, каждая — отдельная страница.structured bindings, if constexpr, std::optional/variant/string_view, parallel algorithms, class template argument deduction — plus a dozen smaller but constantly-used improvements. 18 features, each its own page.
Убирают многословность и ручные обходные пути, накопившиеся за C++98–14.Remove verbosity and manual workarounds accumulated since C++98–14.
Разбор tuple/pair/struct на именованные переменные одной строкой — конец std::tie и .first/.second.Unpacking a tuple/pair/struct into named variables in one line — the end of std::tie and .first/.second.
Переменная, живущая только внутри условия и его веток — не утекает в окружающий скоуп.A variable that lives only inside the condition and its branches — doesn't leak into the surrounding scope.
Ветвление на этапе компиляции внутри шаблона — конец SFINAE-трюков ради простого выбора кода.Compile-time branching inside a template — the end of SFINAE tricks for a simple code choice.
static-член класса с определением прямо в заголовочном файле — без ODR-нарушений при подключении в несколько единиц трансляции.A static class member defined right in the header — no ODR violations when included in multiple translation units.
Свёртка parameter pack оператором в одно выражение — конец рекурсивных шаблонов ради суммы/конъюнкции.Folding a parameter pack with an operator into one expression — the end of recursive templates just to sum or AND things together.
std::pair(1, 2.0) вместо std::pair<int, double>(1, 2.0) — компилятор выводит параметры шаблона класса из конструктора.std::pair(1, 2.0) instead of std::pair<int, double>(1, 2.0) — the compiler deduces class template parameters from the constructor.
Стандартизированные атрибуты вместо компиляторных расширений — компилятор предупреждает о конкретных классах ошибок.Standardized attributes instead of compiler extensions — the compiler warns about specific classes of mistakes.
Возврат prvalue из функции больше не требует move/copy-конструктора вообще — это часть формальной семантики языка, не оптимизация компилятора.Returning a prvalue from a function no longer requires a move/copy constructor at all — this is part of the language's formal semantics, not a compiler optimization.
Уже частично упомянуты в cpp_ts_extensions.md как фичи, доехавшие из экспериментального TS до стандарта.Already partly covered in cpp_ts_extensions.md as features that made it from the experimental TS into the standard.
Тип «значение или его отсутствие» без указателей и магических sentinel-значений.A "value or its absence" type without pointers or magic sentinel values.
Типобезопасное объединение (discriminated union) — замена union и ручных tagged struct.A type-safe discriminated union — a replacement for raw unions and hand-rolled tagged structs.
Контейнер для значения произвольного типа, определяемого в рантайме — типобезопасная альтернатива void*.A container for a value of any type, determined at runtime — a type-safe alternative to void*.
Невладеющее представление строки — параметры функций без лишнего копирования std::string.A non-owning view of a string — function parameters without an unnecessary std::string copy.
Портируемая работа с путями, файлами и директориями — конец boost::filesystem и платформенных #ifdef.Portable work with paths, files, and directories — the end of boost::filesystem and platform-specific #ifdefs.
std::execution::par как второй параметр std::sort и других алгоритмов — параллелизм без ручных потоков.std::execution::par as a second parameter to std::sort and other algorithms — parallelism without manual threads.
Единообразный вызов чего угодно вызываемого (функция, member pointer, лямбда) и вызов функции с аргументами из tuple.A uniform way to call anything callable (function, member pointer, lambda) and to call a function with arguments taken from a tuple.
Тип «сырой байт памяти» без арифметики char и без путаницы с символьными типами.A "raw memory byte" type without char arithmetic and without confusion with character types.
Полноценная поддержка массивов в shared_ptr — до C++17 требовала кастомного deleter вручную.Full array support in shared_ptr — before C++17 it required a hand-written custom deleter.
Конвертация число↔строка без локали, без исключений, без аллокаций — на порядок быстрее printf/sstream.Number↔string conversion with no locale, no exceptions, no allocations — an order of magnitude faster than printf/sstream.
порядок чтенияreading order
structured bindings и if/switch-init стоит читать первыми — они меняют повседневный стиль кода сильнее остальных и встречаются в примерах для более поздних фич этого же стандарта. if constexpr важен перед тем, как переходить на C++20 concepts — это его прямой предшественник в задаче "выбрать код на этапе компиляции".structured bindings and if/switch-init are worth reading first — they change everyday coding style more than the rest and show up in examples for later features of this same standard. if constexpr matters before moving on to C++20 concepts — it's the direct predecessor in the "pick code at compile time" problem.
std::optional/variant/any/string_view пересекаются с TS-контекстом из cpp_ts_extensions.md — стоит свериться при чтении, что там уже устарело после финализации в стандарте.std::optional/variant/any/string_view overlap with the TS context in cpp_ts_extensions.md — worth cross-checking what there became outdated once these were finalized into the standard.