Is there any way to identify a type in a generic and portable way for serialization? I know std::type_index
and std::type_info
are platform dependent and can't be used for serialization.
One way would be to make a map between std::type_index
and one "type information" and to serialize the "type information", but this will slow down the serialization.
Is there any standard way of doing this?
PS: I want to learn how to do efficient serialization, I don't want to use a library.