Skip to content

Nonstandard integer type #89

Closed
Closed

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

Activity

  1. nlohmann commented on Jun 15, 2015

    @nlohmann
    Owner

    I understand the problem - it is a conflict with the solution to issue #71. I see what I can do.

  2. self-assigned this
    on Jun 15, 2015
  3. changed the title [-]Build issue on OSX with C++14[/-] [+]Nonstandard integer type[/+] on Jun 15, 2015
  4. nlohmann commented on Jun 15, 2015

    @nlohmann
    Owner

    Your code example should work now - I added a respective test case.

  5. arnaudbrejeon commented on Jun 15, 2015

    @arnaudbrejeon
    Author

    It's working perfectly. Thank you for your super-fast feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions