I have Class RoomData
with this fields:
#include <string>
class RoomData
{
public:
int id;
string name;
int maxPlayers;
int timePerQuestion;
int isActive;
};
and i'm trying to turn vactor of RoomData Vector<RoomData>
to json array
this what i tried:
#include <nlohmann/json.hpp>
using nlohmann::json;
string serialize(vector<RoomData> roomData)
{
json j(roomData);
string jsonArray = j.dump();
return jsonArray;
}
But it gives me these Errors:
C2338 forcing MSVC stacktrace to show which T we're talking about.
C2338 could not find to_json() method in T's namespace
C2065 'force_msvc_stacktrace': undeclared identifier
C2825 'decayed': must be a class or namespace when followed by '::'
C2510 'decayed': left of '::' must be a class/struct/union