-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
example code for ifstream reading a json file results in no operator error #1766
Comments
Try changing version to 3.6.1. Should fix the problem (Wasn't working for me also on 3.7.0) |
In order to asses your issue, we need the following information:
|
I have the same issue and in addition I get an E0349 with Visual Studio 2019. |
Can you please paste the exact error message? This code works without issues: #include <iostream>
#include "json.hpp"
#include <fstream>
using json = nlohmann::json;
int main()
{
std::ifstream in("test.json");
nlohmann::json j;
in >> j;
std::cout << j << std::endl;
} |
I have the same problem, using Visual Studio 2019 with latest version (3.7.0) Problem is this line. |
No, we did no remove this operator, but only deprecate it. |
Here are the 3 errors I get Severity Code Description Project File Line Suppression State Severity Code Description Project File Line Suppression State Severity Code Description Project File Line Suppression State |
Which compiler are you using? |
I’m using Visual Studio 2019 (latest)
ISO C++17 Standard (std:c++17)
But I just noticed these are not compiler errors, they are IntelliSence errors.
|
is where the problem occurs, with the >> the only thing resulting in an error. I got the setup from the example code for reading json files. This is happening in a header file. Everything compiles with warnings and will run, but errors out when it gets to this point.
C++ no operator matches these operands operand types are: std::ifstream >> json
is the exact text given when hovering over the red underlined >>;
Not sure what I'm missing, sorry if it's obvious but I tried to find a solution elsewhere first.
The text was updated successfully, but these errors were encountered: