You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the issue you have?
Compilation error on latest Visual Studio 2017 compiler.
Works with Visual Studio 2015 compiler.
error C2679: binary '=': no operator found which takes a right-hand operand of type
'nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>'
(or there is no acceptable conversion)
Please describe the steps to reproduce the issue. Can you provide a small but working code example?
intmain()
{
nlohmann::json jsonTest;
std::pair<int, int> intPair(10, 20);
jsonTest["intPair"] = intPair;
intPair = jsonTest["intPair"]; // compilation error on this line
}
What is the expected behavior?
Same as intPair = jsonTest["intPair"].get<std::pair<int,int>>();
Which compiler and operating system are you using? Is it a supported compiler?
-- Building for: Visual Studio 15 2017
-- The CXX compiler identification is MSVC 19.16.27027.1
-- Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
-- Windows 10
Did you use a released version of the library or the version from the develop branch?
Release v3.5.0
The text was updated successfully, but these errors were encountered:
pmhpereira
changed the title
Compilation error getting a std::pairt<T1, T2> on latest VS 2017
Compilation error getting a std::pair<T1, T2> on latest VS 2017
Mar 7, 2019
pmhpereira
changed the title
Compilation error getting a std::pair<T1, T2> on latest VS 2017
Compilation error getting a std::pair<> on latest VS 2017 compiler
Mar 7, 2019
Compilation error on latest Visual Studio 2017 compiler.
Works with Visual Studio 2015 compiler.
What is the expected behavior?
Same as
intPair = jsonTest["intPair"].get<std::pair<int,int>>();
Which compiler and operating system are you using? Is it a supported compiler?
-- Building for: Visual Studio 15 2017
-- The CXX compiler identification is MSVC 19.16.27027.1
-- Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
-- Windows 10
Did you use a released version of the library or the version from the
develop
branch?Release v3.5.0
If you experience a compilation error: can you compile and run the unit tests?
Can compile. No errors.
The text was updated successfully, but these errors were encountered: