diff --git boost/chrono/io/duration_get.hpp boost/chrono/io/duration_get.hpp index 6014603..938cb73 100644 --- boost/chrono/io/duration_get.hpp +++ boost/chrono/io/duration_get.hpp @@ -467,7 +467,7 @@ namespace boost * translation in other contexts, as e.g. days and weeks. * * @param facet the duration_units facet - * @param s start input stream iterator. + * @param i start input stream iterator. * @param e end input stream iterator. * @param ios a reference to a ios_base. * @param err the ios_base state. @@ -484,6 +484,10 @@ namespace boost const string_type* k = chrono_detail::scan_keyword(i, e, units, units_end, //~ std::use_facet >(loc), err); + if (err & (std::ios_base::badbit | std::ios_base::failbit)) + { + return i; + } if (!facet.match_n_d_valid_unit(k)) { err |= std::ios_base::failbit; @@ -499,7 +503,7 @@ namespace boost * translation in other contexts, as e.g. days and weeks. * * @param facet the duration_units facet - * @param s start input stream iterator. + * @param i start input stream iterator. * @param e end input stream iterator. * @param ios a reference to a ios_base. * @param err the ios_base state. @@ -519,7 +523,10 @@ namespace boost const string_type* k = chrono_detail::scan_keyword(i, e, units, units_end, //~ std::use_facet >(loc), err); - + if (err & (std::ios_base::badbit | std::ios_base::failbit)) + { + return i; + } if (!facet.match_valid_unit(k, rt)) { err |= std::ios_base::failbit;