-
Notifications
You must be signed in to change notification settings - Fork 33
add missing check for MAX_NUM_ARRAY_ELEMENTS in the std::array pack/unpack. Also c++20 syntax update. #1443
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
Conversation
spoonincode
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be nice, since you're touching them anyways, to update these to c++20 syntax. but obviously not critical and can go as-is
Hopefully this is what you were thinking of. |
…riate. - pointers are `std::trivially_copyable` - we may have a type for which FC_REFLECT was defined, which we serialize without alignment padding between members. But that type can also be `std::trivially_copyable`, and we wouldn't want to serialize it with padding when in a `std::array`.
|
Upon reflection, I don't think
|
std::is_trivially_copyable_v trait for array serialization in raw.hpp|
@heifner @spoonincode I made some changes in this PR (realized |
|
My understanding is |
I think the problem is if someone has struct foo {
uint32_t bar;
uint64_t baz;
};
FC_REFLECT(foo, (bar)(baz));This is a trivially copyable type (std::is_trivially_copyable), but has padding. So if someone makes an I wonder how we could detect that something like |
Hum, that's not exactly what I meant. Consider spring/libraries/chain/include/eosio/chain/authority.hpp Lines 95 to 97 in 25978a6
A So that would be a consensus change from what we were writing before, as Same issue if the members were in the opposite order,
|
I had the exact same thought! We could detect it if
I don't think we can safely match it, but then I didn't quite get what this does:
|
|
Thanks guys. I did misunderstand the issue at hand.
That just flags that the type works with reflection. It specifies the |
Oh, interesting, so it does write the four |
Add missing check for
MAX_NUM_ARRAY_ELEMENTSin thestd::arrayversions.Also c++20 syntax update.
Resolves #1422.