niXman / yas

Yet Another Serialization
731 stars 95 forks source link

Compile error :when serialize a struct object with 20 parameters #125

Closed Darwinnpos closed 1 year ago

Darwinnpos commented 1 year ago

struct Bar { int a1; int a2; int a3; ... int a20; ... serialize ... };

When load the data, compile error C2243 VS2022

daldegam commented 1 year ago

Try to use this preprocessor macro:

YAS_OBJECT_MAX_MEMBERS=50

niXman commented 1 year ago

@DarwinRepo any news?

Darwinnpos commented 1 year ago

What is the performance loss?

niXman commented 1 year ago

what are you talking about?

Darwinnpos commented 1 year ago

change the preprocessor macro : YAS_OBJECT_MAX_MEMBERS

niXman commented 1 year ago

your question is, will the YAS_OBJECT_MAX_MEMBERS macro affect to performance? if yes - no, it will affect on compilation time.

niXman commented 1 year ago

and, my suggestion is not to use fundamental types like int/long directly, but using standard aliases like std::int32_t/std::int64_t

Darwinnpos commented 1 year ago

thank you