Skip to content

Commit

Permalink
AdjIO: Bug fix for non-GCC compilers
Browse files Browse the repository at this point in the history
On some compilers std::ws sets the failbit if the stream already at
the end. (The Standard does not state anything about the behavior)

Move the operation in the loop below so the program parses the file
correctly.
  • Loading branch information
Itaru Kitayama authored and traymond committed Jul 30, 2013
1 parent 1535e35 commit ca42fc1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Graph/AdjIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ std::istream& read_adj(std::istream& in, ContigGraph<Graph>& g,
if (!adjFormat) {
readDistEdges(ss, g, u ^ sense, betterEP);
} else
for (std::string vname; ss >> vname >> std::ws;) {
for (std::string vname; ss >> vname;) {
ss >> std::ws;
vertex_descriptor v = find_vertex(vname, g);
assert(!edge(u ^ sense, v ^ sense, g).second);
if (ss.peek() == '[') {
Expand Down

0 comments on commit ca42fc1

Please sign in to comment.