-
Notifications
You must be signed in to change notification settings - Fork 226
Feature Request: constexpr glz::read_json and more #2415
Copy link
Copy link
Open
Description
I don't know whether is there a specific blocker to implement something like this. However, with C++26's #embed, I would like to be able to do something like this.
struct Config {
int foo{};
};
template <>
struct glz::meta<Config> {
using T = Config;
static constexpr auto value = object("foo", &T::foo);
};
static constexpr char config_json[] = {
#embed "config.json"
};
static constexpr Config conf;
static constexpr auto error = glz::read_json(conf, config_json);
static_assert(error.ec != glz::error_code::none);
static_assert(conf->foo == 10);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels