Skip to content

Nonstandard integer type #89

@arnaudbrejeon

Description

@arnaudbrejeon

Hi,

the following does not build on OSX with C++14:

#include "nlohmann.json.hpp"
using json = nlohmann::basic_json<std::map, std::vector, std::string, bool, int32_t, float>;
int main(int argc, const char * argv[]) {   
    json j;
    j["int_1"] = 1; << Conversion from 'int' to 'nlohmann::basic_json<std::map, std::vector, std::__1::basic_string<char>, bool, int, float, std::allocator>' is ambiguous
    return 0;
}

I'd rather use number type int32_t instead of the default int64_t (which builds properly). Do you have any idea how to fix this issue?
Thank you,

Arnaud

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions