4#include <nlohmann/json.hpp>
5#include <nlohmann/json_fwd.hpp>
9 template <
typename DataType>
27 template <
typename DataType>
30 json_obj = nlohmann::ordered_json{ {
"min", value.
min }, {
"max", value.
max } };
33 template <
typename DataType>
36 json_obj.at(
"min").get_to(value.
min);
37 json_obj.at(
"max").get_to(value.
max);
42template <
typename DataType>
43class fmt::formatter<
R3B::MinMaxValue<DataType>>
46 static constexpr auto parse(format_parse_context& ctx) {
return ctx.end(); }
47 template <
typename FmtContent>
50 return fmt::format_to(ctn.out(),
"{{min: {}, max: {}}}", value.
min, value.
max);
MinMaxValue< double > MinMaxValueD
MinMaxValue< float > MinMaxValueF
void from_json(const nlohmann::ordered_json &json_obj, MinMaxValue< DataType > &value)
MinMaxValue< int > MinMaxValueI
void to_json(nlohmann::ordered_json &json_obj, const MinMaxValue< DataType > &value)
constexpr MinMaxValue(DataType min_val, DataType max_val)