Opened 8 years ago
Closed 5 years ago
#11168 closed Bugs (fixed)
boost::date_time::subsecond_duration does not handle boost::date_time::special_values graceful
| Reported by: | Owned by: | James E. King, III | |
|---|---|---|---|
| Milestone: | Boost 1.67.0 | Component: | date_time |
| Version: | Boost 1.57.0 | Severity: | Problem |
| Keywords: | posix_time, date_time, neg_infin, pos_infin, not_a_data_time, special_values | Cc: |
Description
Hi,
I just was victim to using boost::date_time::millisec and others in an error prone way, by passing into special values like neg_infin as part of testing.
For me it should at least avoid such abuse at compile time, because such errors are quite hard to find. I already patched our code, so plz find patch attached.
Greetz, ILo.
Ofc one may also allow to pass in those special values into subsecond_duration.
Attachments (1)
Change History (7)
by , 8 years ago
| Attachment: | 25098.patch added |
|---|
comment:1 by , 7 years ago
| Component: | None → date_time |
|---|---|
| Owner: | set to |
comment:2 by , 5 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:3 by , 5 years ago
This affects hours(), minutes(), seconds(), all of the sub-second duration constructors, and also the time_duration constructor itself, since boost::date_time::special_values is an enum and therefore converts automatically to an integral.
comment:5 by , 5 years ago
| Milestone: | To Be Determined → Boost 1.67.0 |
|---|
comment:6 by , 5 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Fix merged to master; resolved.

quickfix