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

std::ifstream >> json error #1948

Closed
finnwrt opened this issue Feb 18, 2020 · 0 comments
Closed

std::ifstream >> json error #1948

finnwrt opened this issue Feb 18, 2020 · 0 comments

Comments

@finnwrt
Copy link

finnwrt commented Feb 18, 2020

  • What is the issue you have?
    I'm trying to open a file and put the contents in a json object

  • Please describe the steps to reproduce the issue. Can you provide a small but working code example?

#include <fstream>
#include "json.hpp"
using json = nlohmann::json;

void foo() {
     std::ifstream i("file.txt");
     json j;
     i >> j;
}
  • And what is the actual behavior instead?
    Error: C++ no operator matches these operands operand types are: std::ifstream >> json

  • Which compiler and operating system are you using? Is it a supported compiler?
    Windows 10, VS2019

  • Did you use a released version of the library or the version from the develop branch?
    Latest release of json.hpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant