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

Specialize cetl::type_id_value<T> for built-in types and cv-qualified types #109

Open
pavel-kirienko opened this issue Mar 22, 2024 · 1 comment

Comments

@pavel-kirienko
Copy link
Member

Enabling the CETL RTTI capability for built-in types will enable their use with cetl::any.

Pseudocode:

template <typename T>
constexpr type_id type_id_value = T::_get_type_id_();  // This is already defined in CETL.
template <> constexpr type_id type_id_value<bool>{{<UUID>}};
template <> constexpr type_id type_id_value<char>{{<UUID>}};
template <> constexpr type_id type_id_value<signed char>{{<UUID>}};
template <> constexpr type_id type_id_value<unsigned char>{{<UUID>}};
template <> constexpr type_id type_id_value<int>{{<UUID>}};
template <> constexpr type_id type_id_value<unsigned int>{{<UUID>}};
...

ALSO, we need specializations for cv-qualified types that implicitly remove the cv-qualifiers, similar to variant_alternative_t et al.

@pavel-kirienko
Copy link
Member Author

We'll also require specializations of is_instance_of and rtti_cast for the case where has_type_id is true while is_rtti_convertible is false.

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