Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom meta<T> without value #1523

Open
SenseOnline opened this issue Dec 24, 2024 · 1 comment
Open

Custom meta<T> without value #1523

SenseOnline opened this issue Dec 24, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@SenseOnline
Copy link

Thanks for the great library.

It would be nice to be able to do this if it can be supported.
To support having an unknown_reader, unknown_writer and maybe others within the custom meta without having to redefine the entirety of the struct.

struct bigJson 
{
   /* ... */
};

template<>
struct glz::meta<bigJson>
{
    static constexpr auto unknown_read{ /* ... */ };
    static constexpr auto unknown_write{ /* ... */ };
};

This currently produces the following error on Visual Studio 2022 due to concept detail::global_meta_t<T> evaluating to false:
glaze\json\read.hpp(116,33): static_assert failed: 'unknown_read type not handled'

@stephenberry
Copy link
Owner

Thanks for bringing this up. It would be nice to be able to specify only the unknown key map and reflect on all the other values automatically. I'll keep this issue alive, but it will probably be some time before it is addressed.

@stephenberry stephenberry added the enhancement New feature or request label Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants