Skip to content

Improve Configuration

Simon Spannagel requested to merge p-improve-config into main

I realized we can be smarter about the getting of values:

  • Let's do the casting business directly with config::Value
  • Let's merge the std::vector<T> stuff with the rest, we can access the vector type via T::value_type
  • Added support for MsgPack::type::BIN via std::vector<char>. I considered std::byte as alternative, but you can't even fill a vector with an initializer list - it's terrible.
  • Support setting strings from char[N] and std::string_view.
  • better handle NIL/std::monostate, e.g. by returning an empty vector when accessing a std::monostate element as vector - this is how we build it from MsgPack, no type is kept (msgpack would allow for a different type in every array entry).

This will let also other code (e.g, using Dictionary or List directly) make use of the casting business.

Open questions:

  • Should we also do overflow checking when casting values into narrower types in Value::get()?

This should solve #17

Edited by Simon Spannagel

Merge request reports