diff --git a/include/ylt/struct_pack/foreach_macro.h b/include/ylt/struct_pack/foreach_macro.h index 0f70411c0..bad21f650 100644 --- a/include/ylt/struct_pack/foreach_macro.h +++ b/include/ylt/struct_pack/foreach_macro.h @@ -13,8 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "ylt/reflection/internal/arg_list_macro.hpp" + #pragma once +#include "ylt/reflection/internal/arg_list_macro.hpp" // clang-format off #define STRUCT_PACK_CONCAT_(l, r) l ## r diff --git a/website/docs/en/struct_pack/struct_pack_tips.md b/website/docs/en/struct_pack/struct_pack_tips.md index cd8791604..e5e08a62b 100644 --- a/website/docs/en/struct_pack/struct_pack_tips.md +++ b/website/docs/en/struct_pack/struct_pack_tips.md @@ -110,7 +110,7 @@ Currently we do not allow the `DISABLE_ALL_META_INFO` configuration to be enable 1. The type to serialize should be legal struct_pack type.。See document:[struct_pack type system](https://alibaba.github.io/yalantinglibs/en/struct_pack/struct_pack_type_system.html)。 2. struct_pack support update protocol by add struct_pack::compatible field, which is forward backward compatibility. User should make sure the version number is increment for each update. It's not allow to delete/modify exist field. See : [document](https://alibaba.github.io/yalantinglibs/en/struct_pack/struct_pack_type_system.html#%E5%85%BC%E5%AE%B9%E7%B1%BB%E5%9E%8B) -3. Using the `YLT_REFL` macro, a maximum of 124 fields are supported by default. Without using macros, the number of struct members should not exceed 256. +3. Using the `YLT_REFL` macro, a maximum of 256(in msvc 124) fields are supported by default. Without using macros, the number of struct members should not exceed 256. ## How to Extend the Limit on Struct Fields diff --git a/website/docs/en/struct_pack/struct_pack_type_system.md b/website/docs/en/struct_pack/struct_pack_type_system.md index 1acaab383..80eb635f6 100644 --- a/website/docs/en/struct_pack/struct_pack_type_system.md +++ b/website/docs/en/struct_pack/struct_pack_type_system.md @@ -216,7 +216,7 @@ The class needs to provide: `size()`,`flip()`,`set()`,`reset()`,`count()`,and th ## Struct -`struct_pack` supports `struct` type. Up to **256** fields are supported and nested fields are supported too. All members +`struct_pack` supports `struct` type. Up to **256** fields are supported(We can also extend it, see document of "struct pack tips") and nested fields are supported too. All members should be of valid `struct_pack` type. struct type could be `struct/class/std::tuple/tuplet::tuple/std::pair` diff --git a/website/docs/zh/struct_pack/struct_pack_tips.md b/website/docs/zh/struct_pack/struct_pack_tips.md index d7f73c4ed..a0140c977 100644 --- a/website/docs/zh/struct_pack/struct_pack_tips.md +++ b/website/docs/zh/struct_pack/struct_pack_tips.md @@ -114,7 +114,7 @@ auto result = struct_pack::deserialize( 1. 序列化的类型必须是struct_pack类型系统中的合法类型。详见:struct_pack的类型系统。See document:[struct_pack 类型系统](https://alibaba.github.io/yalantinglibs/zh/struct_pack/struct_pack_type_system.html)。 2. struct_pack允许新增struct_pack::compatible字段,并保证其前向/后向的兼容性,只要每次协议变更时填入的版本号大于上一次的版本号即可。如果删除/修改了已有字段,则无法保证兼容性。详见[文档](https://alibaba.github.io/yalantinglibs/zh/struct_pack/struct_pack_type_system.html#%E5%85%BC%E5%AE%B9%E7%B1%BB%E5%9E%8B) -3. 使用YLT_REFL宏,默认最多支持注册124个字段。不使用宏,结构体成员不应超过256个。 +3. 使用YLT_REFL宏,默认最多支持注册256(msvc 默认124)个字段。不使用宏,结构体成员不应超过256个。 ## 如何扩展结构体字段上限 diff --git a/website/docs/zh/struct_pack/struct_pack_type_system.md b/website/docs/zh/struct_pack/struct_pack_type_system.md index c614e508e..23a29dee0 100644 --- a/website/docs/zh/struct_pack/struct_pack_type_system.md +++ b/website/docs/zh/struct_pack/struct_pack_type_system.md @@ -219,7 +219,7 @@ concept unique_ptr = requires(Type ptr) { ## 结构体 -struct_pack支持结构体类型。结构体内可以包含最多256个字段,并允许结构体嵌套。结构体中的任何成员都必须是struct_pack的合法类型。 +struct_pack支持结构体类型。默认支持最多256个字段,也可以扩展支持更多字段(见struct_pack提示章节),并允许结构体嵌套。结构体中的任何成员都必须是struct_pack的合法类型。 struct_pack的结构体类型可以为:struct/class/std::pair/tuplet::tuple/std::tuple