title: reading json file with std::eof while using nlohmann::json
body: <p>I'm trying to read from JSON file with the while condition is the <code>std::eof</code></p>
  
  <p>but I'm getting the following exption :</p>
  
  <blockquote>
    <p>terminate called after throwing an instance of
    'nlohmann::detail::parse_error'   what(): 
    [json.exception.parse_error.101] parse error at line 1, column 1:
    syntax error while parsing value - unexpected end of input; expected
    '[', '{', or a literal</p>
  </blockquote>
  
  <p>this is the file :</p>
  
  <blockquote>
    <p>[{"id":0,"price":0,"qty":0},{"id":1,"price":1,"qty":1}]</p>
  </blockquote>
  
  <p>and this is the code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;json.hpp&gt;
  #include &lt;fstream&gt;
  using json = nlohmann::json;
  int main() {
    std::ofstream f;
    f.open("test.json",std::ios_base::trunc |std::ios_base::out);
    json result = json::array();
    for(int i =0 ;i &lt; 2 ; i++)
    {
      json j = {
          {"id",i},
          {"qty",i},
          {"price",i}
      };
      result.push_back(j);
    }
    f &lt;&lt; result;
    f.close();
    std::ifstream j;
    std::string line;
    j.open("test.json",std::ios_base::in);
    json ob;
    while (!j.eof())
    {
      j&gt;&gt;ob;
      std::cout &lt;&lt; ob &lt;&lt; "\n";
    }
    j.close();
    return 0;
  }
  </code></pre>