Moving comments and JSON schema from glz::object for faster compilation (support moved to glz::json_schema) #823
stephenberry
started this conversation in
Optimization
Replies: 2 comments
-
@jbbjarnason, what are your thoughts on this simplification and moving |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm considering as a first step to simply remove |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Specializing a
glz::meta
that defines avalue = glz::object(...)
is very common for Glaze users. Even with reflection potentially coming in C++26 and the current aggregate initializable reflection, we will always needglz::meta
or something like it in order to define changes to default reflection (like renaming, wrappers, glz::custom, and lambdas).Right now
glz::object
supports passing in comments andglz::schema
as the second or third argument for each field (depending on whether the field uses reflection on the member name).This discussion is about removing the ability to add comments and
glz::schema
to theglz::object
call. I am not proposing losing any functionality, only requiring users to move their documentation and JSON schema objects toglz::json_schema
. With the introduction ofglz::json_schema
, we can now add comments and JSON schema information outside ofglz::meta
.This simplification in what
glz::object
accepts will improve compile times for most users and simplify the code.glz::object
will still optionally support renaming members and registering wrappers and lambda functions. This change would only affect comments and JSON Schema.Add your thoughts to this discussion. I don't want to make breaking API changes unless it benefits users long term. And, I think this would benefit users in the long term by simplifying the codebase and especially making compile times faster.
Beta Was this translation helpful? Give feedback.
All reactions