Glaze v5 Breaking Change Proposals #1439
Replies: 3 comments 1 reply
-
Remove
|
Beta Was this translation helpful? Give feedback.
-
You can add support for ADL functions along with old detail::to/from namespace decl
{
struct my_type{};
}
template<>
struct glz::from<decl::my_type>{}
namespace decl
{
next code
} You just declare ADL in the same namespace as Your strong type. namespace decl
{
struct my_type{};
auto glz_from_op( my_type & ) -> required_return_type;
} All You need to add is just add like namespace glz
{
template<typename T>
concept adl_from_support = rquires(T const & v)
{
{ glz_from_op(v) } -> std::same_as< required_return_type>;
};
template<adl_from_support T>
struct from<JSON, T> { ... };
} Such adl option would be very comfortable for user single/strong type use cases (not for simple_enum) |
Beta Was this translation helpful? Give feedback.
-
Change options.
In this case you can even create concept for
And this will apply only for csv format, because json_option_t can't fit it and won't use. But this point not, because .float_precision is valid for csv and json for example and can be used in both formats.
And some big template magic I guess to handle this |
Beta Was this translation helpful? Give feedback.
-
This discussion is to provide a space for writing down API breaking changes for Glaze version 5 that would help bring more clarity to the library.
Beta Was this translation helpful? Give feedback.
All reactions