Skip to content

std::is_constructible<json, std::unordered_map<std::string, Data>> when to_json not defined #1805

Description

@cbegue

Building the following code failed:

#include <string>
#include <tuple>
#include <unordered_map>
#include <nlohmann/json.hpp>

struct Data {
    int mydata;
    float myfloat;
};

int main() {
    using nlohmann::json;

    static_assert(!std::is_constructible<json, std::unordered_map<std::string, Data>>::value, "");
}

With the following error:

static assertion failed
     static_assert(!std::is_constructible<json, std::unordered_map<std::string, Data>>::value, "");

std::is_constructible<json, std::unordered_map<std::string, Data>>::value should be false

Activity

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions