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

Register fixed size string array-like type #381

Open
Belfer opened this issue Mar 11, 2025 · 1 comment
Open

Register fixed size string array-like type #381

Belfer opened this issue Mar 11, 2025 · 1 comment

Comments

@Belfer
Copy link

Belfer commented Mar 11, 2025

I have a string class with constant storage to avoid memory allocations on strings I know their fixed size, the class is defined as:

template <SizeType N>
class CString;

If I try to register a class with a property member of this type then the compiler will complain about not finding the type associated to it:
'rttr::type::get': no matching overloaded function found

Since it's a templated class I can't use the normal registration API, is there a workaround for this? Perhaps specialize some type implementation detail?

@Belfer
Copy link
Author

Belfer commented Mar 12, 2025

Looking through the docs I saw sequential_container_mapper, which btw is mostly the same documentation as the associative_container_mapper , so the info there is incorrect, however, looking at the header it refers to:
#include <sequential_mapper.h>

I found the following line of code:

template<typename T, std::size_t N>
struct sequential_container_mapper<std::array<T, N>> : detail::sequential_container_base_static<std::array<T, N>> {};

And while there is no specialization for the std::string type in this file, this is closer to what I'm trying to do.
If I can get a pointer to where the string type specialization is located I can work off that.

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