diff --git a/include/ki/pclass/Casters.h b/include/ki/pclass/Casters.h index 540c465..eb981bd 100644 --- a/include/ki/pclass/Casters.h +++ b/include/ki/pclass/Casters.h @@ -183,6 +183,24 @@ namespace detail } }; + /** + * Caster implementation for casting from json to + * bit integers (bi and bui) + */ + template + struct value_caster> + : value_caster_impl> + { + using type = typename BitInteger::type; + + BitInteger cast_value(const nlohmann::json &value) const override + { + return BitInteger( + static_cast(value) + ); + } + }; + /** * Caster implementation for casting from json to a * std::string.