Opened 8 years ago
Closed 8 years ago
#10992 closed Bugs (fixed)
Chrono IO state savers inconsistent with Boost.IO state savers
Reported by: | rkawulak | Owned by: | viboes |
---|---|---|---|
Milestone: | Boost 1.58.0 | Component: | chrono |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
The constructors of Boost.IO state savers taking the second new_value argument set the state to the new_value immediately and restore the previous state upon destruction. OTOH, the Boost.Chrono IO state savers do something different (and arguably unintuitive): they don't alter the state upon construction at all and restore the state to new_value rather than the previous state upon destruction. The behaviour should be aligned with that of Boost.IO to avoid confusion and make it more useful.
Change History (10)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
Status: | new → assigned |
---|
comment:3 by , 8 years ago
Yes. The second constructor should be implemented the following way to be consistent with IO state saver semantics (see for example basic_ios_iostate_saver):
duration_style_io_saver(state_type &s, aspect_type new_value) : s_save_(s), a_save_(get_duration_style(s)) { set_duration_style(s, new_value); }
The same for all the remaining Chrono IO state savers.
comment:4 by , 8 years ago
Thanks for catching this point. I missed it completly. I should stop adding code that I don't test.
comment:7 by , 8 years ago
Milestone: | To Be Determined → Boost 1.58.0 |
---|
comment:10 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Please, could you be more explicit?
Are you referring to