File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/core/json/include/sourcemeta/core Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -77,8 +77,9 @@ concept json_auto_map_like =
77
77
78
78
// / @ingroup json
79
79
template <typename T>
80
- concept json_auto_tuple_mono =
81
- std::tuple_size_v<std::remove_cvref_t <std::tuple<T>>> == 1 ;
80
+ concept json_auto_tuple_mono = requires {
81
+ typename std::tuple_size<std::remove_cvref_t <T>>::type;
82
+ } && (std::tuple_size_v<std::remove_cvref_t <T>> == 1 );
82
83
83
84
// We have to do this mess because MSVC seems confuses `std::pair`
84
85
// of 2 elements with this overload
@@ -233,10 +234,9 @@ auto to_json(const std::pair<L, R> &value) -> JSON {
233
234
234
235
// Handle 1-element tuples
235
236
// / @ingroup json
236
- template <json_auto_tuple_mono T>
237
- auto to_json (const std::tuple<T> &value) -> JSON {
237
+ template <json_auto_tuple_mono T> auto to_json (const T &value) -> JSON {
238
238
auto tuple = JSON::make_array ();
239
- std::apply ([&](const T &element) { tuple.push_back (to_json (element)); },
239
+ std::apply ([&](const auto &element) { tuple.push_back (to_json (element)); },
240
240
value);
241
241
return tuple;
242
242
}
You can’t perform that action at this time.
0 commit comments