[struct_pack]struct filed more than 100 support #880
-
|
Hi there, my struct has more than 300 memebers, each of them represent a signal from bus and will not easily change its structure. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
|
The simple way is add a nested struct so that each struct has members no more than 256. |
Beta Was this translation helpful? Give feedback.
-
感谢答复,不瞒你说我暂时动不了结构体定义,基于这个前提按照您的方法我需要做一个结构体映射,增加了使用成本和外部序列化时间。 |
Beta Was this translation helpful? Give feedback.
-
这个结构体你需要定义struct_pack_refl宏吗?这个宏目前是只能支持124个元素。原因是MSVC编译器的默认上限。 |
Beta Was this translation helpful? Give feedback.
-
|
我看看怎么改下代码,然后加一个文档说明一下如何支持更多元素。默认是256现在。 |
Beta Was this translation helpful? Give feedback.
-
|
你目前的情况,可以试下修改 |
Beta Was this translation helpful? Give feedback.
-
|
member_macro.hpp拓展后,其他参数如 MaxVisitMembers 等需要配合改动吗? |
Beta Was this translation helpful? Give feedback.
-
MaxVisitMembers只是用来static_assert的,如果出现static_assert报错你也可以改下。 |
Beta Was this translation helpful? Give feedback.
-
|
Now we refact the code. |
Beta Was this translation helpful? Give feedback.
Now we refact the code.
Please see document of struct_pack_tips about how to expend limitation of field numbers.