Closed GoogleCodeExporter closed 8 years ago
Could you please post the output you get from the code you posted?
Original comment by jbe...@gmail.com
on 26 Mar 2012 at 4:33
http://imgur.com/iTggx
Original comment by ezjonas
on 26 Mar 2012 at 4:37
Can you upload the file "test2.yml" so I can see exactly the bytes you're using?
Original comment by jbe...@gmail.com
on 26 Mar 2012 at 5:09
The line
YAML::Parser parser(ifstream("test2.yml"));
shouldn't actually compile. There is no constructor for YAML::Parser that takes
a std::istream by value or reference-to-const; only by reference.
Instead, you should do something like
ifstream fin("test2.yml")
YAML::Parser parser(fin);
My best guess as to what's happening is that in the confusion that follows
binding a temporary to a non-const reference, it only keeps the file stream
open long enough to read one chunk of the file into memory, so you're only
getting the first portion of the file.
Original comment by jbe...@gmail.com
on 26 Mar 2012 at 7:19
Oh, ok, well I'll fix it.
So why does it compile ? Isn't visual C++ not supposed to compiled it ?
Original comment by ezjonas
on 26 Mar 2012 at 7:34
That's right, Visual C++ should issue an error here. See
http://stackoverflow.com/questions/5032756/unforgiving-gcc-c-compiler
for more info.
Original comment by jbe...@gmail.com
on 26 Mar 2012 at 8:00
thanks
Original comment by ezjonas
on 26 Mar 2012 at 8:03
Original issue reported on code.google.com by
ezjonas
on 26 Mar 2012 at 10:56