Skip to content

Commit

Permalink
fix conversation
Browse files Browse the repository at this point in the history
  • Loading branch information
poor-circle committed Jan 14, 2025
1 parent 5b6fdd9 commit 22e69d2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion include/ylt/struct_pack/foreach_macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion website/docs/en/struct_pack/struct_pack_tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion website/docs/en/struct_pack/struct_pack_type_system.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion website/docs/zh/struct_pack/struct_pack_tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ auto result = struct_pack::deserialize<struct_pack::DISABLE_ALL_META_INFO,rect>(

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个。

## 如何扩展结构体字段上限

Expand Down
2 changes: 1 addition & 1 deletion website/docs/zh/struct_pack/struct_pack_type_system.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 22e69d2

Please sign in to comment.