@@ -28,16 +28,16 @@ https://en.cppreference.com/w/cpp/language/types[fundamental types], such as
2828include::../../../test/snippets.cpp[tag=snippet_conv_1,indent=0]
2929----
3030
31- For the type `T` , the appropriate conversion approach is chosen from the
32- following list of categories. The first matching category is selected .
31+ For the type `T` , the appropriate conversion approach is the first matching
32+ category from the following list .
3333
3434.Conversion categories
3535[%autowidth,cols=4]
3636|===
3737|Category of T|Comment|`value_from` behavior|`value_to` behavior
3838
39- |Custom conversion.
40- |
39+ |Custom conversion
40+ |Uses `tag_invoke` overload.
4141|Custom behavior.
4242|Custom behavior.
4343
@@ -55,66 +55,66 @@ following list of categories. The first matching category is selected.
5555|
5656a| The result is a number equal to input and has the type
5757
58- * `std::int64_t` , if `T` is a signed integer' ; or
58+ * `std::int64_t` , if `T` is a signed integer; or
5959* `std::uint64_t` , if `T` is an unsigned integer; or
6060* `double` otherwise.
6161|The result is created via <<ref_value_to_number>>.
6262
63- |Type satisfying <<ref_is_null_like >>
63+ |<<ref_null_category >>
6464|Intended for types like {std_monostate} .
6565|The result is a null value.
6666|The result is default-constructed.
6767
68- |Type satisfying <<ref_is_string_like>>.
69- |A sequence of `char` s, e.g. `std::string` .
68+ |<<ref_string_category>>
69+ |A sequence of `` char`` s, e.g. {std_string} .
7070|The result is a <<ref_string>>.
7171|The result is constructed from a <<ref_string_view>>.
7272
73- |Type satisfying <<ref_is_variant_like>>.
74- |`std::variant` and similar types, e.g. `boost::variant2::variant` .
73+ |<<ref_variant_category>>
74+ |{std_variant} and similar types, e.g. {ref_variant} .
7575|The result is equal to the result of conversion of the active variant
7676 alternative.
7777|The result holds the first alternative for which a conversion succeeds.
7878
79- |Type satisfying <<ref_is_optional_like >>
80- |
79+ |<<ref_optional_category >>
80+ |{std_optional} and similar types, e.g. {ref_optional} .
8181|If the input value is empty, the result is a `null` . Otherwise it is
8282 equivalent to conversion of the object stored inside of optional.
8383|The result is default constructed if the input value is `null` . Otherwise the
8484 result is constructed from the result of conversion of the input to the
8585 type stored in optional.
8686
87- |Type satisfying <<ref_is_map_like>>.
88- |A one-to-one mapping (e.g. `std::map` ) with string-like keys.
87+ |<<ref_map_category>>
88+ |A one-to-one mapping (e.g. {std_map} ) with string-like keys.
8989|The result is an <<ref_object>>.
9090|The result is default-constructed, and elements are `insert` -ed at the end.
9191
92- |Type satisfying <<ref_is_sequence_like>>.
93- |A sequence of elements, e.g. `std::vector` .
92+ |<<ref_sequence_category>>
93+ |A sequence of elements, e.g. {std_vector} .
9494|The result is an <<ref_array>>.
9595|The result is default-constructed, and elements are `insert` -ed at the end.
9696
97- |Type satisfying <<ref_is_tuple_like>>.
98- |A heterogenous sequence with fixed size, e.g. `std::tuple` and `std::pair` .
97+ |<<ref_tuple_category>>
98+ |A heterogenous sequence with fixed size, e.g. {std_tuple} and {std_pair} .
9999|The result is an <<ref_array>>.
100100|The result is constructed with the array elements as constructor arguments.
101101
102- |Type satisfying <<ref_is_described_class >>
102+ |<<ref_described_class_category >>
103103|
104104|The result is an <<ref_object>> with described members' names as keys.
105105|The result is default-constructed and described members are assigned
106106 corresponding values.
107107
108- |Type satisfying <<ref_is_described_enum >>
108+ |<<ref_described_enum_category >>
109109|
110110|If the input value is equal to one of the described enumerators, the result is
111111 a <<ref_string>>, containing its name. Otherwise it's equal to the input
112112 value converted to its underlying type.
113113|The result is the described enumerator, corresponding to the input
114114 <<ref_string>>.
115115
116- |Type satisfying <<ref_is_path_like>>.
117- |`std::filesystem::path` and similar types, e.g. `boost::filesystem::path` .
116+ |<<ref_path_category>>
117+ |{std_path} and similar types, e.g. {ref_path} .
118118|The result is equal to the result of `path::generic_string` .
119119|The result is constructed from two pointers to `const char` .
120120|===
@@ -127,10 +127,10 @@ contained objects is applied recursively. For example:
127127include::../../../test/snippets.cpp[tag=snippet_conv_recursive,indent=0]
128128----
129129
130- Here, the map is converted into an <<ref_object>>, since it matches
131- <<ref_is_map_like >>. Each of its keys is converted into a <<ref_string>>, as
132- `std::string` matches <<ref_is_string_like >>, and each of its values is
133- converted into an <<ref_array>>, as `std::pair` matches <<ref_is_tuple_like >>.
130+ Here, the map is converted to an <<ref_object>>, since its conversion category
131+ is <<ref_map_category >>. Each of its keys is converted into a <<ref_string>>,
132+ as `std::string` is of <<ref_string_category >>, and each of its values is
133+ converted into an <<ref_array>>, as `std::pair` is of <<ref_tuple_category >>.
134134Finally, elements of pairs are converted into a `std::int64_t` number and
135135a `bool` .
136136
0 commit comments