From fbdab3ec236aeed8d8e31535d998df556dd54943 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 10 May 2014 18:51:33 -0700 Subject: Add comment on why we enable stream exceptions --- examples/roundtrip/driver.cxx | 3 +++ 1 file changed, 3 insertions(+) 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); -- cgit v1.1