-
Notifications
You must be signed in to change notification settings - Fork 9
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
member are arrays/lists/vectors of unknown types #114
Comments
Hello! The only thing you can do in this regard is to check if the type has an index operator The types for which out-of-the-box index operators are defined can be found here: https://github.com/BlackMATov/meta.hpp/blob/main/headers/meta.hpp/meta_detail/value_traits/index_traits.hpp But keep in mind that this library does not have such abstractions over containers as in RTTR for a variety of reasons, the main one being that it only works in special cases and has big problems in general. P.S. Also, you can see another traits here: https://github.com/BlackMATov/meta.hpp/tree/main/headers/meta.hpp/meta_detail/value_traits |
You can also mark your members with metadata when binding to differentiate them. |
Will this suffice for simple iteration? For something like a for loop? How do I get .size() for that? That is really as far as I need to go, no further |
I think I can add something like length_traits and specialize it for sequence-like containers. |
how difficult would it be to also implement a way to get and set values of that vector? Specifically speaking, I mean how rttr can just sort of get a array like thing where every element is now a variant:
In meta.hpp, it would be every element being turned into uvalue. I am trying to imitate this behaviour in some way, but it appears I cannot. |
Yes, that would be great, but it might be a lot more complicated than it seems at first glance. Anyway, give me a few days, i'm going to think about it in the background. |
Thank you for considering, I will try to find alternative solutions for now |
So now we have But we still don't have a way to set values by index, and I'm not sure that I'm ready to implement that, since the concept of traits should be reconsidered, perhaps towards an analog of RTTR views or something similar. |
I think I can probably hack something together, this should be just enough. Thank you very much |
Okay, so I think I did come up with a temporary solution, creating a method that when called will take in uvalues and modify the value at an index. But then this gave me an idea: why not just get pointers for the elemnts of a vector/array? As in create a uvalue for a pointer for each element? And we only do it if a user activates this feature with a function of somekind. IDK, I'm just spitballing. |
This is an interesting idea, but not flexible enough to include in the library. We need to be able to set values by index with dynamic values. Returning a pointer to an element we need to know the static type to fully work with it, this is not what is needed. |
hmmm, in that case, I'll just leave it alone, since I barely know how this stuff works. The level of abstractions are completely alien to me. I'll keep this issue open just in case. |
Hi, how do I get the data from a member that is a vector? Keep in mind I do not know what kind of values this vector has
The text was updated successfully, but these errors were encountered: