I'm using json object with Electronic Arts' EASTL library, which provides high performance implementations of std containers. I use the following typedef:
using stdjson = nlohmann::basic_json<std::map,
std::vector,
stdstring,
bool,
int64_t,
uint64_t,
double,
jsonallocator,
nlohmann::adl_serializer>;
where stdstring is eastl::string, which is their version of std::string. Then throughout my code, I just always use stdjson type. This works great, except for when json code assumes std::string. For example, this code:
for (auto& cam : sjson["cameras"].items()) {
stdstring cameraname(cam.key());
}
fails to compile because of this code in iteration_proxy.hpp:
template<typename string_type>
void int_to_string( string_type& target, std::size_t value )
{
target = std::to_string(value);
}
which assumes std::string is the string_type. I'm using Visual Studio 2019 on Windows 10 using the latest release of json.
I'm using json object with Electronic Arts' EASTL library, which provides high performance implementations of std containers. I use the following typedef:
where stdstring is eastl::string, which is their version of std::string. Then throughout my code, I just always use stdjson type. This works great, except for when json code assumes std::string. For example, this code:
fails to compile because of this code in iteration_proxy.hpp:
which assumes std::string is the string_type. I'm using Visual Studio 2019 on Windows 10 using the latest release of json.