@@ -13,10 +13,18 @@ namespace std {
1313 template<class F, tuple-like Tuple>
1414 constexpr decltype(auto)
1515 apply(F&& f, Tuple&& t) noexcept(see below); // (1) C++23
16+
17+ template<class F, tuple-like Tuple>
18+ constexpr apply_result_t<F, Tuple>
19+ apply(F&& f, Tuple&& t)
20+ noexcept(is_nothrow_applicable_v<F, Tuple>); // (1) C++26
1621}
1722```
1823* tuple-like[link tuple-like.md]
1924* tuple-like[link tuple-like.md]
25+ * tuple-like[link tuple-like.md]
26+ * apply_result_t[link /reference/type_traits/apply_result.md]
27+ * is_nothrow_applicable_v[link /reference/type_traits/is_nothrow_applicable.md]
2028
2129## 概要
2230タプルを展開し、関数の引数に適用してその関数を実行する。
@@ -69,7 +77,8 @@ return apply-impl(std::forward<F>(f), std::forward<Tuple>(t),
6977
7078
7179## 例外
72- C++23から : ` I ` をパラメータパック` 0, 1, ..., ( ` [ ` tuple_size_v ` ] ( tuple_size.md ) ` < ` [ ` remove_reference_t ` ] ( /reference/type_traits/remove_reference.md ) ` <Tuple>>-1) ` としたとき、例外指定の式は次と等価 : ` noexcept( ` [ ` invoke ` ] ( /reference/functional/invoke.md ) ` (std::forward<F>(f), get<I>(std::forward<Tuple>(t))...)) `
80+ - C++23から : ` I ` をパラメータパック` 0, 1, ..., ( ` [ ` tuple_size_v ` ] ( tuple_size.md ) ` < ` [ ` remove_reference_t ` ] ( /reference/type_traits/remove_reference.md ) ` <Tuple>>-1) ` としたとき、例外指定の式は次と等価 : ` noexcept( ` [ ` invoke ` ] ( /reference/functional/invoke.md ) ` (std::forward<F>(f), get<I>(std::forward<Tuple>(t))...)) `
81+ - C++26から : 例外指定は[ ` is_nothrow_applicable_v ` ] ( /reference/type_traits/is_nothrow_applicable.md ) ` <F, Tuple> `
7382
7483
7584## 例
@@ -117,6 +126,9 @@ hello
117126- [`std::tuple`](../tuple.md)
118127- [INVOKE](/reference/concepts/Invoke.md)
119128- [`tuple-like`](tuple-like.md)
129+ - [`apply_result`](/reference/type_traits/apply_result.md)
130+ - [`is_applicable`](/reference/type_traits/is_applicable.md)
131+ - [`is_nothrow_applicable`](/reference/type_traits/is_nothrow_applicable.md)
120132
121133
122134## 参照
@@ -130,3 +142,5 @@ hello
130142 - C++20から効果説明の`decay_t`を`remove_cvref_t`へ変更。
131143- [P2517R1 Add a conditional `noexcept` specification to `std::apply`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2517r1.html)
132144 - C++23から条件付きで`noexcept`例外指定が行われる。
145+ - [P1317R2 Remove return type deduction in `std::apply`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p1317r2.pdf)
146+ - C++26から戻り値型が`decltype(auto)`から`apply_result_t<F, Tuple>`に変更され、SFINAEフレンドリーになった。
0 commit comments