json: Compilation error with std::map on vs 2015

using json = nlohmann::json;
json j;
std::map<std::string, std::string> m;
m = j.get<decltype(m)>();

it says error C2665: 'std::pair<const _Kty,_Ty>::pair': none of the 2 overloads could convert all the argument types

if I change to

m = j;

it says 'operator =' is ambiguous

Did I miss anything about converting map data to/from json ?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (9 by maintainers)

Most upvoted comments

I have no problem with VS2015 14.0.25431.01 Update 3 and the latest develop version.

I found if I change std::map<std::string, std::string> to std::map<std::string, int>, then it works without problems.