From Jason Turner

[tuple.apply]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmphsw80kui/{from.md → to.md} +4 -11
tmp/tmphsw80kui/{from.md → to.md} RENAMED
@@ -1,13 +1,14 @@
1
  ### Calling a function with a `tuple` of arguments <a id="tuple.apply">[[tuple.apply]]</a>
2
 
3
  ``` cpp
4
  template<class F, tuple-like Tuple>
5
- constexpr decltype(auto) apply(F&& f, Tuple&& t) noexcept(see below);
 
6
  ```
7
 
8
- *Effects:* Given the exposition-only function:
9
 
10
  ``` cpp
11
  namespace std {
12
  template<class F, tuple-like Tuple, size_t... I>
13
  constexpr decltype(auto) apply-impl(F&& f, Tuple&& t, index_sequence<I...>) {
@@ -22,28 +23,20 @@ Equivalent to:
22
  ``` cpp
23
  return apply-impl(std::forward<F>(f), std::forward<Tuple>(t),
24
  make_index_sequence<tuple_size_v<remove_reference_t<Tuple>>>{});
25
  ```
26
 
27
- *Remarks:* Let `I` be the pack
28
- `0, 1, ..., (tuple_size_v<remove_reference_t<Tuple>> - 1)`. The
29
- exception specification is equivalent to:
30
-
31
- ``` cpp
32
- noexcept(invoke(std::forward<F>(f), get<I>(std::forward<Tuple>(t))...))
33
- ```
34
-
35
  ``` cpp
36
  template<class T, tuple-like Tuple>
37
  constexpr T make_from_tuple(Tuple&& t);
38
  ```
39
 
40
  *Mandates:* If `tuple_size_v<remove_reference_t<Tuple>>` is 1, then
41
  `reference_constructs_from_temporary_v<T, decltype(get<0>(declval<Tuple>()))>`
42
  is `false`.
43
 
44
- *Effects:* Given the exposition-only function:
45
 
46
  ``` cpp
47
  namespace std {
48
  template<class T, tuple-like Tuple, size_t... I>
49
  requires is_constructible_v<T, decltype(get<I>(declval<Tuple>()))...>
 
1
  ### Calling a function with a `tuple` of arguments <a id="tuple.apply">[[tuple.apply]]</a>
2
 
3
  ``` cpp
4
  template<class F, tuple-like Tuple>
5
+ constexpr apply_result_t<F, Tuple> apply(F&& f, Tuple&& t)
6
+ noexcept(is_nothrow_applicable_v<F, Tuple>);
7
  ```
8
 
9
+ *Effects:* Given the exposition-only function template:
10
 
11
  ``` cpp
12
  namespace std {
13
  template<class F, tuple-like Tuple, size_t... I>
14
  constexpr decltype(auto) apply-impl(F&& f, Tuple&& t, index_sequence<I...>) {
 
23
  ``` cpp
24
  return apply-impl(std::forward<F>(f), std::forward<Tuple>(t),
25
  make_index_sequence<tuple_size_v<remove_reference_t<Tuple>>>{});
26
  ```
27
 
 
 
 
 
 
 
 
 
28
  ``` cpp
29
  template<class T, tuple-like Tuple>
30
  constexpr T make_from_tuple(Tuple&& t);
31
  ```
32
 
33
  *Mandates:* If `tuple_size_v<remove_reference_t<Tuple>>` is 1, then
34
  `reference_constructs_from_temporary_v<T, decltype(get<0>(declval<Tuple>()))>`
35
  is `false`.
36
 
37
+ *Effects:* Given the exposition-only function template:
38
 
39
  ``` cpp
40
  namespace std {
41
  template<class T, tuple-like Tuple, size_t... I>
42
  requires is_constructible_v<T, decltype(get<I>(declval<Tuple>()))...>