Qx v0.5.8
Qt Extensions Library
Loading...
Searching...
No Matches
QxJson::json_convertible Concept Reference

Specifies that a type is generally convertible to/from JSON. More...

Concept definition

template<typename T>
concept QxJson::json_convertible = requires(T& tValue) {
{ Converter<T>::fromJson(tValue, QJsonValue()) } -> std::same_as<Qx::JsonError>;
{ Converter<T>::toJson(tValue) } -> qjson_type;
}
Specifies that a type is generally convertible to/from JSON.
Definition qx-json.h:295
The Converter template struct acts as an interface that carries details on how to parse/serialize JSO...
Definition qx-json.h:267

Detailed Description

Specifies that a type has override conversions for changing to/from JSON.

Satisfied if a Converter specialization exists for T that includes functions with the signatures:

where R is any type that satisfies the qjson_type concept.

Satisfied if QX_JSON_MEMBER_OVERRIDE() has been used to add functions to a JSON-tied struct with the signatures:

where R is any type that satisfies the qjson_type concept.