Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no instance of overloaded function "std::swap" matches the specified type #1159

Closed
ghost opened this issue Jul 11, 2018 · 4 comments
Closed
Labels
platform: visual studio related to MSVC solution: invalid the issue is not related to the library

Comments

@ghost
Copy link

ghost commented Jul 11, 2018

  • What is the issue you have?
    Cannot compile in Visual Studio 2017 after including json.hpp

  • Please describe the steps to reproduce the issue. Can you provide a small but working code example?
    This line - 18474 inline void swap(nlohmann::json& j1, generates the following error
    Severity Code Description Project File Line Suppression State
    Error (active) E0493 no instance of overloaded function "std::swap" matches the specified type

  • Did you use a released version of the library or the version from the develop branch?
    Tried 3.01 and 3.12 develop

  • If you experience a compilation error: can you compile and run the unit tests?

I'm able to cmake the project but unable to compile after including it... I've tried:
ISO C++ latest draft and ISO C++ 17. I'm not able to go to any earlier versions due to dependencies.

@ghost
Copy link
Author

ghost commented Jul 11, 2018

Weird. I blew away the project, remade the project and everything worked.
#JustMicrosoftThings ...

@ghost ghost closed this as completed Jul 11, 2018
@nlohmann nlohmann added solution: invalid the issue is not related to the library platform: visual studio related to MSVC labels Jul 11, 2018
@ghost
Copy link

ghost commented Aug 2, 2018

I'm having the exact same issue.

It's some sort of IntelliSense issue - anyone know how to fix it?

@nlohmann if you can, please file a bug report for this issue with MSDN.

@nlohmann
Copy link
Owner

nlohmann commented Aug 2, 2018

I am not using MSVC myself, so I cannot really file a bug report on this.

@ghost
Copy link
Author

ghost commented Aug 2, 2018

Here's the deal -- I did a little thinking on this and I think that it is possible that the JSON file being referenced could affect this bug. When I remade my project I rebuild the config file as well and I did it in a slightly different way. It may be something to look at ...

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: visual studio related to MSVC solution: invalid the issue is not related to the library
Projects
None yet
Development

No branches or pull requests

1 participant