tmp/tmpq2rudzxh/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Variable template `format_kind` <a id="format.range.fmtkind">[[format.range.fmtkind]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
template<ranges::input_range R>
|
| 5 |
+
requires same_as<R, remove_cvref_t<R>>
|
| 6 |
+
constexpr range_format format_kind<R> = see below;
|
| 7 |
+
```
|
| 8 |
+
|
| 9 |
+
A program that instantiates the primary template of `format_kind` is
|
| 10 |
+
ill-formed.
|
| 11 |
+
|
| 12 |
+
For a type `R`, `format_kind<R>` is defined as follows:
|
| 13 |
+
|
| 14 |
+
- If `same_as<remove_cvref_t<ranges::range_reference_t<R>>, R>` is
|
| 15 |
+
`true`, `format_kind<R>` is `range_format::disabled`. \[*Note 1*: This
|
| 16 |
+
prevents constraint recursion for ranges whose reference type is the
|
| 17 |
+
same range type. For example, `std::filesystem::path` is a range of
|
| 18 |
+
`std::filesystem::path`. — *end note*]
|
| 19 |
+
- Otherwise, if the *qualified-id* `R::key_type` is valid and denotes a
|
| 20 |
+
type:
|
| 21 |
+
- If the *qualified-id* `R::mapped_type` is valid and denotes a type,
|
| 22 |
+
let `U` be `remove_cvref_t<ranges::range_reference_t<R>>`. If either
|
| 23 |
+
`U` is a specialization of `pair` or `U` is a specialization of
|
| 24 |
+
`tuple` and `tuple_size_v<U> == 2`, `format_kind<R>` is
|
| 25 |
+
`range_format::map`.
|
| 26 |
+
- Otherwise, `format_kind<R>` is `range_format::set`.
|
| 27 |
+
- Otherwise, `format_kind<R>` is `range_format::sequence`.
|
| 28 |
+
|
| 29 |
+
*Remarks:* Pursuant to [[namespace.std]], users may specialize
|
| 30 |
+
`format_kind` for cv-unqualified program-defined types that model
|
| 31 |
+
`ranges::input_range`. Such specializations shall be usable in constant
|
| 32 |
+
expressions [[expr.const]] and have type `const range_format`.
|
| 33 |
+
|