Closed psaripp closed 4 years ago
Hello,
member(value)
returns an lvalue reference to the member object. Try with std::is_class_v<std::remove_reference_t<decltype(member(value))>>
.
You might also want to take a look at the implementation of runtime::debug
(here), which also supports reflectable types, primitives and arbitrary containers.
Also, note that while your comment about is_readable
is correct, neither length
nor magnitude
is marked with property()
.
Inheritance is supported well since v0.11.0, there is no reason why any type traits would fail to work. Member types are exposed via result_type for functions and value_type for fields, and can be obtained by decltype(member(value))
as you've discovered. Stl containers can also be supported easily and are by the built-in write function. Nested types, template types and function and overloaded functions are all supported.
Please, also check the docs for:
Does this answer your question?
Hi, thanks for the answer, I highly appreciate.
With serialisation, I'm only interested in fields which are both readable and writable (due bi-direction) so marking as property()
is not really suitable in this scenario.
I'm working on a comprehensive serializer which has to support a couple of scenarios, such as
I'm using the following example code below:
I'd like to use it in more complex scenarios like this. Is there any legitimate way to do this?