Ambiguous function call to get with pointer type and constant json object in VS2015 (15.4.4) #852
Labels
platform: visual studio
related to MSVC
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
This code will not compile in Visual Studio 2015 (15.4.4) with the latest nlohmann::json code:
The error message is:
Seems like Visual Studio's compiler can't decide whether to use ValueType version of get(), or PointerType one. The issue is easily worked around by using get_ptr() instead, but I still would like to report it, as it was working in older versions of the library (2.0.5, for example).
The issue can be fixed by adding
to enable_if template of ValueType get() const noexcept method.
The text was updated successfully, but these errors were encountered: