Skip to content

json::value_t can't be a map's key type in VC++ 2015 #486

Description

@Getfree

The following code does not compile in Visual Studio 2015, but compiles fine in GCC.

#include <string>
#include <map>
#include <iostream>

#include "json.hpp"
using JSON = nlohmann::json ;

int main (){
	using namespace std ;
	
	map<JSON::value_t,string> jsonTypes ;

	jsonTypes[JSON::value_t::array] = "array" ;

	cout << jsonTypes[ JSON({"val1", 123, false}) ] << endl ;
}

Wandbox: http://melpon.org/wandbox/permlink/Izdt8DW4UGpVQdUd

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