メインコンテンツへスキップ
見出し画像

C++17

    WIP

    コア言語機能 (Core Language Features)


    • 構造化束縛 (Structured Bindings): auto [a, b] = tuple_or_struct;

    • 初期化文付き条件分岐: if (init; condition) / switch (init; condition)

    • constexpr if 文: if constexpr (condition)

    • クラステンプレートの実引数推定 (CTAD): std::pair p(1, 2.0);

    • インライン変数 (Inline Variables): ヘッダー定義可能な inline 変数

    • 畳み込み式 (Fold Expressions): (... + args)

    • 非型テンプレート引数の auto 指定: template <auto V>

    • constexpr ラムダ式 (ラムダ式の暗黙的/明示的 constexpr 対応)

    • ラムダ式での *this コピーキャプチャ: [*this] { ... }

    • アライメント付き動的メモリ確保 (alignas を考慮した new / delete)

    • 保証されたコピー省略 (Guaranteed Copy Elision: prvalue 最適化)

    • 厳格化された式の評価順序 (Refined Evaluation Order)

    • UTF-8 文字リテラル: u8'x'

    • 16進浮動小数点リテラル: 0x1.2p3

    • ネストした名前空間定義構文: namespace A::B::C { ... }

    • 属性構文の拡張:

      • [[nodiscard]]

      • [[maybe_unused]]

      • [[fallthrough]]

      • 列挙子および名前空間への属性付与

      • 属性名前空間のスコープ省略: [[using CC: opt1, opt2]]

    • プリプロセッサ条件式: __has_include

    標準ライブラリ:新設ヘッダー (New Headers)


    • <string_view>

    • <optional>

    • <variant>

    • <any>

    • <filesystem>

    • <memory_resource>

    • <execution>

    • <charconv>

    標準ライブラリ:新設クラス・型 (New Types / Classes)


    【ユーティリティ・ボキャブラリ型】

    • std::string_view

    • std::wstring_view

    • std::u16string_view

    • std::u32string_view

    • std::optional

    • std::nullopt_t, std::nullopt

    • std::in_place_t, std::in_place

    • std::variant

    • std::monostate

    • std::bad_variant_access

    • std::any

    • std::bad_any_cast

    • std::any_cast

    • std::byte

    【ファイルシステム (std::filesystem)】

    • std::filesystem::path

    • std::filesystem::filesystem_error

    • std::filesystem::directory_entry

    • std::filesystem::directory_iterator

    • std::filesystem::recursive_directory_iterator

    • std::filesystem::file_status

    • std::filesystem::space_info

    • std::filesystem::file_type

    • std::filesystem::perms

    • std::filesystem::perm_options

    • std::filesystem::copy_options

    • std::filesystem::directory_options

    【並列実行ポリシー (std::execution)】

    • std::execution::sequenced_policy (std::execution::seq)

    • std::execution::parallel_policy (std::execution::par)

    • std::execution::parallel_unsequenced_policy (std::execution::par_unseq)

    【メモリアロケーション (std::pmr)】

    • std::pmr::memory_resource

    • std::pmr::polymorphic_allocator

    • std::pmr::monotonic_buffer_resource

    • std::pmr::synchronized_pool_resource

    • std::pmr::unsynchronized_pool_resource

    • std::pmr::new_delete_resource

    • std::pmr::null_memory_resource

    • std::pmr::get_default_resource

    • std::pmr::set_default_resource

    • 各種コンテナエイリアス (std::pmr::string, std::pmr::vector, std::pmr::map 等)

    【同期プリミティブ】

    • std::shared_mutex

    • std::scoped_lock

    標準ライブラリ:新設関数・アルゴリズム (New Functions & Algorithms)


    【高速文字列・数値相互変換 (<charconv>)】

    • std::to_chars

    • std::from_chars

    【数値・数学関数 (<numeric>, <cmath>)】

    • std::clamp

    • std::gcd

    • std::lcm

    • std::reduce

    • std::transform_reduce

    • std::inclusive_scan

    • std::exclusive_scan

    • std::transform_inclusive_scan

    • std::transform_exclusive_scan

    【特殊数学関数 (<cmath>)】

    • std::assoc_laguerre, std::assoc_laguerref, std::assoc_laguerrel

    • std::assoc_legendre, std::assoc_legendref, std::assoc_legendrel

    • std::beta, std::betaf, std::betal

    • std::comp_ellint_1, std::comp_ellint_1f, std::comp_ellint_1l

    • std::comp_ellint_2, std::comp_ellint_2f, std::comp_ellint_2l

    • std::comp_ellint_3, std::comp_ellint_3f, std::comp_ellint_3l

    • std::cyl_bessel_i, std::cyl_bessel_if, std::cyl_bessel_il

    • std::cyl_bessel_j, std::cyl_bessel_jf, std::cyl_bessel_jl

    • std::cyl_bessel_k, std::cyl_bessel_kf, std::cyl_bessel_kl

    • std::cyl_neumann, std::cyl_neumannf, std::cyl_neumannl

    • std::ellint_1, std::ellint_1f, std::ellint_1l

    • std::ellint_2, std::ellint_2f, std::ellint_2l

    • std::ellint_3, std::ellint_3f, std::ellint_3l

    • std::expint, std::expintf, std::expintl

    • std::hermite, std::hermitef, std::hermitel

    • std::legendre, std::legendref, std::legendrel

    • std::laguerre, std::laguerref, std::laguerrel

    • std::riemann_zeta, std::riemann_zetaf, std::riemann_zetal

    • std::sph_bessel, std::sph_besself, std::sph_bessell

    • std::sph_legendre, std::sph_legendref, std::sph_legendrel

    • std::sph_neumann, std::sph_neumannf, std::sph_neumannl

    【アルゴリズム拡張 (<algorithm>)】

    • std::for_each_n

    • std::sample

    • std::default_searcher

    • std::boyer_moore_searcher

    • std::boyer_moore_horspool_searcher

    • 既存アルゴリズムの並列実行ポリシーオーバーロード(std::sort, std::find など約70個)

    【ファイルシステム操作関数 (std::filesystem)】

    • std::filesystem::absolute

    • std::filesystem::canonical / weakly_canonical

    • std::filesystem::relative / proximate

    • std::filesystem::copy / copy_file / copy_symlink

    • std::filesystem::create_directory / create_directories

    • std::filesystem::create_hard_link / create_symlink / create_directory_symlink

    • std::filesystem::current_path

    • std::filesystem::exists

    • std::filesystem::equivalent

    • std::filesystem::file_size

    • std::filesystem::hard_link_count

    • std::filesystem::last_write_time

    • std::filesystem::permissions

    • std::filesystem::read_symlink

    • std::filesystem::remove / remove_all

    • std::filesystem::rename

    • std::filesystem::resize_file

    • std::filesystem::space

    • std::filesystem::status / symlink_status

    • std::filesystem::temp_directory_path

    • std::filesystem::is_block_file / is_character_file / is_directory / is_empty

    • std::filesystem::is_fifo / is_other / is_regular_file / is_socket / is_symlink

    • std::filesystem::status_known

    【ユーティリティ・メモリオブジェクト構築・破棄】

    • std::apply

    • std::make_from_tuple

    • std::as_const

    • std::size

    • std::empty

    • std::data

    • std::visit

    • std::invoke

    • std::destroy_at

    • std::destroy

    • std::destroy_n

    • std::uninitialized_move

    • std::uninitialized_move_n

    • std::uninitialized_value_construct

    • std::uninitialized_value_construct_n

    • std::uninitialized_default_construct

    • std::uninitialized_default_construct_n

    標準ライブラリ:型特性 (Type Traits)


    【論理メタ関数】

    • std::conjunction / std::conjunction_v

    • std::disjunction / std::disjunction_v

    • std::negation / std::negation_v

    【呼び出し可能・ポインタ・変換特性】

    • std::is_invocable / std::is_invocable_v

    • std::is_invocable_r / std::is_invocable_r_v

    • std::is_nothrow_invocable / std::is_nothrow_invocable_v

    • std::is_nothrow_invocable_r / std::is_nothrow_invocable_r_v

    • std::invoke_result / std::invoke_result_t

    • std::is_swappable / std::is_swappable_v

    • std::is_nothrow_swappable / std::is_nothrow_swappable_v

    • std::is_swappable_with / std::is_swappable_with_v

    • std::is_nothrow_swappable_with / std::is_nothrow_swappable_with_v

    • std::is_aggregate / std::is_aggregate_v

    • std::has_unique_object_representations / std::has_unique_object_representations_v

    • std::void_t

    【変数テンプレートエイリアス (_v 版)】

    • 既存のすべての Type Traits に対する *_v エイリアス (例: std::is_same_v, std::is_integral_v 等)

    既存コンテナおよびライブラリの拡張


    • 連想コンテナ (map, set, unordered_map, unordered_set) のノード抽出・再挿入:

      • container.extract()

      • container.merge()

    • 連想コンテナのキー挿入・更新メソッド:

      • container.try_emplace()

      • container.insert_or_assign()

    • std::map / std::unordered_map におけるノードキーの直接書き換え

    • スマートポインタ配列対応:

      • std::shared_ptr<T[]>

      • std::shared_ptr<T[N]>

    • std::string::data() の非 const ポインタ返却オーバーロード

    • std::string / std::string_view 間の相互運用・コンストラクタ追加


    参照:

    #C #cpp #cpp17 #programming #tutorial#modern#study #STL #std #lib


     

    遊月

     
     
    うつ回復期✨社会恐怖症。 SESなエンジニア (元ゲームPG) 日々学習、プログラミング、アニメゲーム、ドール、天然石が好き。 日記を中心に様々な情報をお届け。生成AIで遊んでます。 🗒️'20/6/8~

    あなたへのおすすめ