-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Closed
Description
- 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?
int main()
{
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 asintPair = 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
developbranch?
Release v3.5.0 -
If you experience a compilation error: can you compile and run the unit tests?
Can compile. No errors.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels