4#include <nlohmann/json.hpp>
8 template <
typename DataType>
26 template <
typename DataType>
29 json_obj = nlohmann::ordered_json{ {
"min", value.
min }, {
"max", value.
max } };
32 template <
typename DataType>
35 json_obj.at(
"min").get_to(value.
min);
36 json_obj.at(
"max").get_to(value.
max);
41template <
typename DataType>
42class fmt::formatter<
R3B::MinMaxValue<DataType>>
45 static constexpr auto parse(format_parse_context& ctx) {
return ctx.end(); }
46 template <
typename FmtContent>
49 return 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)