Skip to content

Is here any elegant way to combine serialization and deserialization code? #2028

@NukeBird

Description

@NukeBird

I know everything can be much easier with reflection, but sadly C++ doesn't have it

When I'm writing code I noticed I'm repeating myself, serialization and deserialization looks very similar

How can I serealize and deserialize things in elegant way? For example lets say we want to serialize this:

struct Human
{
std::string name;
int age;
};

and then deserialize it back. As I said earlier, if it's possible I wanna combine serialization and deserialization code

thanks for your help in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions