C++ Logo

std-proposals

Advanced search

[std-proposals] chrono::hh_mm_ss constructor defined in terms of abs

From: Michael Welsh Duggan <mwd_at_[hidden]>
Date: Tue, 03 Jun 2025 16:24:19 -0400
The text describing the constructor for chrono::hh_mm_ss defines what it
does partially using the chrono::abs function. However, the chrono::abs
function is not defined for unsigned durations. I feel as if limiting
construction of hh_mm_ss objects to only be from signed durations was
not intentional.

Should the standard be changed to consider abs in this context to be
solely for exposition? Should a different wording be used? Or is
constructing an hh_mm_ss from an unsigned duration somehow "wrong"?

Honestly, I think having chrono::abs being undefined for unsigned types
was a mistake, but that ship may have already sailed. Thoughts?

-- 
Michael Welsh Duggan
(md5i_at_[hidden])

Received on 2025-06-03 20:30:05