Closed WeaveAche closed 8 months ago
base is an empty struct here so the assertion on packer.hpp:419
fails. But since struct_pack already supports serializing std::unique_ptr<base>
it should do it in this case too?
Ok this happens because the STRUCT_PACK_DERIVED_IMPL
macro needs to be in the header file.
Search before asking
What happened + What you expected to happen
Compilation error when a class contains std::unique_ptr but works fine otherwise. Expect to compile in both cases.
Reproduction way
base.hpp
derived.hpp
common.cpp
main.cpp
Compiled with
g++ main.cpp common.cpp -I yalantinglibs/include
. The compilation fails whenderived::member
isstd::unique_ptr<base>
but works fine if it is anything else.Anything else
No
Are you willing to submit a PR?