tmp/tmp5ddtngt8/{from.md → to.md}
RENAMED
|
@@ -1,86 +1,65 @@
|
|
| 1 |
### Tuple-like access to pair <a id="pair.astuple">[[pair.astuple]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
template <class T1, class T2>
|
| 5 |
-
struct tuple_size<pair<T1, T2>>
|
| 6 |
-
: integral_constant<size_t, 2> { };
|
| 7 |
```
|
| 8 |
|
| 9 |
``` cpp
|
| 10 |
tuple_element<0, pair<T1, T2>>::type
|
| 11 |
```
|
| 12 |
|
| 13 |
-
*Value:*
|
| 14 |
|
| 15 |
``` cpp
|
| 16 |
tuple_element<1, pair<T1, T2>>::type
|
| 17 |
```
|
| 18 |
|
| 19 |
-
*Value:*
|
| 20 |
|
| 21 |
``` cpp
|
| 22 |
template<size_t I, class T1, class T2>
|
| 23 |
-
constexpr tuple_element_t<I, pair<T1, T2>>&
|
| 24 |
-
get(pair<T1, T2>& p) noexcept;
|
| 25 |
template<size_t I, class T1, class T2>
|
| 26 |
-
constexpr const tuple_element_t<I, pair<T1, T2>>&
|
| 27 |
-
get(const pair<T1, T2>& p) noexcept;
|
| 28 |
-
```
|
| 29 |
-
|
| 30 |
-
*Returns:* If `I == 0` returns `p.first`; if `I == 1` returns
|
| 31 |
-
`p.second`; otherwise the program is ill-formed.
|
| 32 |
-
|
| 33 |
-
``` cpp
|
| 34 |
template<size_t I, class T1, class T2>
|
| 35 |
-
constexpr tuple_element_t<I, pair<T1, T2>>&&
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
*Returns:* If `I == 0` returns `std::forward<T1&&>(p.first)`; if
|
| 40 |
-
`I == 1` returns `std::forward<T2&&>(p.second)`; otherwise the program
|
| 41 |
-
is ill-formed.
|
| 42 |
-
|
| 43 |
-
``` cpp
|
| 44 |
-
template <class T, class U>
|
| 45 |
-
constexpr T& get(pair<T, U>& p) noexcept;
|
| 46 |
-
template <class T, class U>
|
| 47 |
-
constexpr const T& get(const pair<T, U>& p) noexcept;
|
| 48 |
-
```
|
| 49 |
-
|
| 50 |
-
*Requires:* `T` and `U` are distinct types. Otherwise, the program is
|
| 51 |
-
ill-formed.
|
| 52 |
-
|
| 53 |
-
*Returns:* `get<0>(p);`
|
| 54 |
-
|
| 55 |
-
``` cpp
|
| 56 |
-
template <class T, class U>
|
| 57 |
-
constexpr T&& get(pair<T, U>&& p) noexcept;
|
| 58 |
```
|
| 59 |
|
| 60 |
-
*
|
| 61 |
-
ill-formed.
|
| 62 |
-
|
| 63 |
-
*Returns:* `get<0>(std::move(p));`
|
| 64 |
|
| 65 |
``` cpp
|
| 66 |
-
template <class
|
| 67 |
-
constexpr
|
| 68 |
-
template <class
|
| 69 |
-
constexpr const
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
```
|
| 71 |
|
| 72 |
-
*Requires:* `
|
| 73 |
ill-formed.
|
| 74 |
|
| 75 |
-
*Returns:* `
|
| 76 |
|
| 77 |
``` cpp
|
| 78 |
-
template <class
|
| 79 |
-
constexpr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
```
|
| 81 |
|
| 82 |
-
*Requires:* `
|
| 83 |
ill-formed.
|
| 84 |
|
| 85 |
-
*Returns:* `
|
| 86 |
|
|
|
|
| 1 |
### Tuple-like access to pair <a id="pair.astuple">[[pair.astuple]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
template <class T1, class T2>
|
| 5 |
+
struct tuple_size<pair<T1, T2>> : integral_constant<size_t, 2> { };
|
|
|
|
| 6 |
```
|
| 7 |
|
| 8 |
``` cpp
|
| 9 |
tuple_element<0, pair<T1, T2>>::type
|
| 10 |
```
|
| 11 |
|
| 12 |
+
*Value:* The type `T1`.
|
| 13 |
|
| 14 |
``` cpp
|
| 15 |
tuple_element<1, pair<T1, T2>>::type
|
| 16 |
```
|
| 17 |
|
| 18 |
+
*Value:* The type T2.
|
| 19 |
|
| 20 |
``` cpp
|
| 21 |
template<size_t I, class T1, class T2>
|
| 22 |
+
constexpr tuple_element_t<I, pair<T1, T2>>& get(pair<T1, T2>& p) noexcept;
|
|
|
|
| 23 |
template<size_t I, class T1, class T2>
|
| 24 |
+
constexpr const tuple_element_t<I, pair<T1, T2>>& get(const pair<T1, T2>& p) noexcept;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
template<size_t I, class T1, class T2>
|
| 26 |
+
constexpr tuple_element_t<I, pair<T1, T2>>&& get(pair<T1, T2>&& p) noexcept;
|
| 27 |
+
template<size_t I, class T1, class T2>
|
| 28 |
+
constexpr const tuple_element_t<I, pair<T1, T2>>&& get(const pair<T1, T2>&& p) noexcept;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
```
|
| 30 |
|
| 31 |
+
*Returns:* If `I == 0` returns a reference to `p.first`; if `I == 1`
|
| 32 |
+
returns a reference to `p.second`; otherwise the program is ill-formed.
|
|
|
|
|
|
|
| 33 |
|
| 34 |
``` cpp
|
| 35 |
+
template <class T1, class T2>
|
| 36 |
+
constexpr T1& get(pair<T1, T2>& p) noexcept;
|
| 37 |
+
template <class T1, class T2>
|
| 38 |
+
constexpr const T1& get(const pair<T1, T2>& p) noexcept;
|
| 39 |
+
template <class T1, class T2>
|
| 40 |
+
constexpr T1&& get(pair<T1, T2>&& p) noexcept;
|
| 41 |
+
template <class T1, class T2>
|
| 42 |
+
constexpr const T1&& get(const pair<T1, T2>&& p) noexcept;
|
| 43 |
```
|
| 44 |
|
| 45 |
+
*Requires:* `T1` and `T2` are distinct types. Otherwise, the program is
|
| 46 |
ill-formed.
|
| 47 |
|
| 48 |
+
*Returns:* A reference to `p.first`.
|
| 49 |
|
| 50 |
``` cpp
|
| 51 |
+
template <class T2, class T1>
|
| 52 |
+
constexpr T2& get(pair<T1, T2>& p) noexcept;
|
| 53 |
+
template <class T2, class T1>
|
| 54 |
+
constexpr const T2& get(const pair<T1, T2>& p) noexcept;
|
| 55 |
+
template <class T2, class T1>
|
| 56 |
+
constexpr T2&& get(pair<T1, T2>&& p) noexcept;
|
| 57 |
+
template <class T2, class T1>
|
| 58 |
+
constexpr const T2&& get(const pair<T1, T2>&& p) noexcept;
|
| 59 |
```
|
| 60 |
|
| 61 |
+
*Requires:* `T1` and `T2` are distinct types. Otherwise, the program is
|
| 62 |
ill-formed.
|
| 63 |
|
| 64 |
+
*Returns:* A reference to `p.second`.
|
| 65 |
|