Closed Nukoooo closed 1 year ago
@Nukoooo
Can you move yyjson::caster<Base>
from net_message.cpp
to net_message.hpp
or processor.cpp
? The location of the definition of the yyjson::cast
seems to be different from the location where it is used.
I checked that the above code can be compiled if the whole is put in the same file.
It works after moving yyjson::caster<Base>
to net_message.hpp
or processor.cpp
Let's say I define my user-define structs in
net_message.hpp
and define yyjson::cast template innet_message.cpp
, if I callyyjson::cast<struct>(*obj)
inprocessor.cpp
, it will throwno matching function for call to ‘yyjson::reader::object::cast<MyStruct>() const’
Some code to reproduce:
Edit:
Code is compiled with C++20Same error on C++23