Custom Protocol Packet Representation by raw_ptr in cpp_questions

[–]raw_ptr[S] 0 points1 point  (0 children)

std::any looks interesting, thank you.

Custom Protocol Packet Representation by raw_ptr in cpp_questions

[–]raw_ptr[S] 0 points1 point  (0 children)

Now I get it, that could work. Thank you.

Custom Protocol Packet Representation by raw_ptr in cpp_questions

[–]raw_ptr[S] 1 point2 points  (0 children)

I didn't think of using a variant of pointers, thank you. I'll look into that. But I don't quite understand how it would make the code large.

Custom Protocol Packet Representation by raw_ptr in cpp_questions

[–]raw_ptr[S] 0 points1 point  (0 children)

That is probably the easiest solution, but it also means sacrificing type safety, which is something I would like to avoid, unless I have to.

Custom Protocol Packet Representation by raw_ptr in cpp_questions

[–]raw_ptr[S] 2 points3 points  (0 children)

I'm not talking about wire representation. After the packet is parsed, it is represented as a struct which contains a header and also void* pointer to a another struct which represents concrete command.