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

Make a concept that indicates when reflect<> can be called on a type #1631

Open
joshuamaiche opened this issue Feb 25, 2025 · 0 comments
Open

Comments

@joshuamaiche
Copy link

Currently, reflectable<T> exists. However, its name is somewhat misleading. If a class has a meta<T> specialization, for instance, reflect<T> is safe to be called on the type. However, reflectable<T> specifically excludes glaze_object_t<T>, which will be true if a class has a specialized meta<T>.

If a developer knows about this, it's an inconvenience. Cases like to<JSON, T> have to check for both reflectable<T> and glaze_object_t<T>. If a developer doesn't know about this, it's way worse, as they will think they're catching all the relevant types with requires reflectable<T>, but are actually missing all the types that have a meta<T> specialization.

Assuming reflectable<T> can't be renamed since it might break others' code, I propose adding a has_reflect<T> concept and using that internally, as an example other devs can follow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant