Replies: 9 comments 8 replies
-
We need more info, could you show me the struct |
Beta Was this translation helpful? Give feedback.
-
It is just an alias
The idea of my code is that each class T will provide a struct type T::State, a constructor that take a T::State and a method that returns a T::State. To ensure this, I created the following concepts:
The main class that I am serializing is this one:
by using calls such as: Feel free to ask for more info. I could also walk you through the relevant parts of my code if you want that. |
Beta Was this translation helpful? Give feedback.
-
ok, so you want to serailize class GameState? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I want to deserialize a GameState::State struct, it does not have pointers. I went back and formatted my posts so the code is clearer, since the template arguments were missing. |
Beta Was this translation helpful? Give feedback.
-
or,show me all the define of the type in GameState::State, such as Gamecoords, GameMap::State. if you can give me a simple reproduce code, i will try to find why compiler crashed. |
Beta Was this translation helpful? Give feedback.
-
I found out that my GameCoords class was not an aggregate type (I should be using GameCoords::State instead, which is a struct with just 2 ints as fields). That is probably why it didn't work. As an aside, is struct_pack able to support nestd vectors? Something like std::vector<std::vector>? Or, for that matter, any nested stl containers...? |
Beta Was this translation helpful? Give feedback.
-
I still have problems, now with nested vectors of bool. I was able to conjure up a minimum reproducible example:
This gives me the following error: Error C2664'struct_pack::err_code struct_pack::detail::unpacker<struct_pack::detail::memory_reader,0,false>::deserialize_one<2,18446744073709551615,true,0,std::_Vb_reference<std::_Wrap_alloc<std::allocatorstd::_Vbase>>>(T &)': cannot convert argument 1 from 'std::_Vb_reference<std::_Wrap_alloc<std::allocatorstd::_Vbase>>' to 'T &' (I didn't know if I should have opened another thread, so I am responding in this one anyway. But the problem is other) |
Beta Was this translation helpful? Give feedback.
-
The |
Beta Was this translation helpful? Give feedback.
-
While trying to compile my project using struct_pack in msvc, the compiler gave me a "C1001: Internal compile error", showing file "reflection.hpp" and line "973". This would be the following line of code:
What is the purpose of the above line of code?
I tried reproducing it outside my project, but was not successful. The only two places where I call any struct_pack functions are:
and the error most likely comes from the second function. Could you give me any help?
(This is my first time posting an Issue in github, I'm sorry if it doesn't qualify as one or if I have been vague, I just really need help)
Beta Was this translation helpful? Give feedback.
All reactions