You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to serialize a vector of a type I created. (ex: std::vector< RoomData >)
So I used the to_json function on the class RoomData:
And serialize it like that: (res.rooms is std::vector< RoomData >)
*Both are found on the same file (the to_json file at the top)
but I'm getting those errors:
nlohmann::adl_serializer<T,void>::to_json no matching overloaded function found (File: json.hpp, line 1256)
Failed to specialize function template 'unknown-type nlohmann::adl_serializer<T,void>::to_json(BasicJsonType &, ValueType &&) noexept()' (File: json.hpp, line 1256)
I'm using the latest version.
Any idea where is this coming from?
The text was updated successfully, but these errors were encountered:
Section Arbitrary types conversions might be helpful. Have you tried marking RoomData& parameter of to_json as a const reference?
As a sidenote, thanks for posting the code as clean and readable. You can also use builtin Markdown support for posting styled code in Github as described here (Examples section under the Codes tab). The plus would be that the code will be copy-able and searchable.
Section Arbitrary types conversions might be helpful. Have you tried marking RoomData& parameter of to_json as a const reference?
As a sidenote, thanks for posting the code as clean and readable. You can also use builtin Markdown support for posting styled code in Github as described here (Examples section under the Codes tab). The plus would be that the code will be copy-able and searchable.
I want to serialize a vector of a type I created. (ex: std::vector< RoomData >)
So I used the to_json function on the class RoomData:

And serialize it like that: (res.rooms is std::vector< RoomData >)

*Both are found on the same file (the to_json file at the top)
but I'm getting those errors:
I'm using the latest version.
Any idea where is this coming from?
The text was updated successfully, but these errors were encountered: