mirror of
https://github.com/nlohmann/json.git
synced 2026-02-10 12:02:28 +00:00
✨ added overload for std::less<value_t> #486
MSVC needs this overload to compile code containing a std::map that uses nlohmann::detail::operator as key.
This commit is contained in:
@@ -795,4 +795,11 @@ TEST_CASE("regression tests")
|
||||
std::string s2 = j2.dump();
|
||||
CHECK(s1 == s2);
|
||||
}
|
||||
|
||||
SECTION("issue #486 - json::value_t can't be a map's key type in VC++ 2015")
|
||||
{
|
||||
// the code below must compile with MSVC
|
||||
std::map<json::value_t, std::string> jsonTypes ;
|
||||
jsonTypes[json::value_t::array] = "array";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user