aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-05-10 18:51:33 -0700
committerBoris Kolpackov <boris@codesynthesis.com>2014-05-10 18:51:33 -0700
commitfbdab3ec236aeed8d8e31535d998df556dd54943 (patch)
tree46de67f254c44221f00b6bcf1e8b0c147126b05f
parent7908c2aa4ea89dc0cbef72b48965f5d6230679b8 (diff)
Add comment on why we enable stream exceptions
-rw-r--r--examples/roundtrip/driver.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/roundtrip/driver.cxx b/examples/roundtrip/driver.cxx
index 7c95538..b83988b 100644
--- a/examples/roundtrip/driver.cxx
+++ b/examples/roundtrip/driver.cxx
@@ -22,6 +22,9 @@ main (int argc, char* argv[])
try
{
+ // Enable stream exceptions so that io failures are reported
+ // as stream rather than as parsing exceptions.
+ //
ifstream ifs;
ifs.exceptions (ifstream::badbit | ifstream::failbit);
ifs.open (argv[1], ifstream::in | ifstream::binary);