libnop icon indicating copy to clipboard operation
libnop copied to clipboard

Could I serialize a class with some "recursive/tree-like" data?

Open jkooooo99 opened this issue 2 years ago • 1 comments

Hi, I am a newbie in C++ and everything...

Could I use this library to serialize my class with some complex data like :

        struct BoneNode
	{
		std::string name;
		glm::mat4 transMatrix;
		std::vector<BoneNode> children;
		int meshBoneId = -1;
		int nonMeshBoneId = -1;
	};

and

std::unordered_map<std::string, size_t> boneExMap ?

The loading speed of FBX is driving me crazy and forcing me to learn some new words like "binary files" and "serialize"...

And sorry for my poor English...

jkooooo99 avatar Feb 25 '23 16:02 jkooooo99

Hi!

Recursive types are supported. Here's an example based on your code: https://godbolt.org/z/K1WbMdKno

Cheers, Corey

eieio avatar Apr 07 '23 22:04 eieio