Can't declare member of array type
If we do:
struct foo {
float data[16];
};
namespace meta {
template <> inline auto registerMembers<foo>() {
return members(member("data", &foo::data));
}
}
we get compile error function returns array because of the Member::getCopy function that returns by value.
Is there any template magic that can be done to disable this function (and all dependent calls) ?
Thank you, and nice job for this library!
Hello. I'll take a look at it soon, pretty sure it can be fixed with some SFINAE. :)
As a temporary workaround - std::array<float, 16> data works well. Looking for a proper fix at the moment.
Can't fix this limitation easily - a lot of stuff needs a rewrite, so I can't promise a fix soon. :(
Ok thanks for looking into this. For the moment I can just comment out the function since I don't need to access members by copy.
Just an FYI, std::array didn't work for me, I had to swap to a vector, reserving the size. (Using MSVC C++20).
Hello I'm surprised that someone still uses this library, haha.
Why, don't you still use it?
I don't. I think it's still useful, but I just didn't use it very much in my engine and decided that straightforward serialization/deserialization functions are easier to read/write. If your function have a lot of members and you need to serialize tons of types into multiple different formats, then it'll be quite useful still, indeed.