[libcxx-commits] [libcxx] [libc++][chrono] Implement LWG 4274: Allow chrono::hh_mm_ss to be constructed from unsigned durations (PR #209686)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Jul 26 08:54:51 PDT 2026
emmett2020 wrote:
> I dropped most of the original PR description because IMO these parts were mostly duplicate of the official description of LWG4274. Please double check the changes.
>
> > * This may incorrectly treat a custom signed type as unsigned. `is_unsigned_v` provides a compile-time path for unsigned types, while the sign check keeps signed and custom types correct.
>
> It's questionable whether a signed user-defined representation type `R` with `numeric_limits<R>::is_signed` being `false` is valid for `duration`. I guess it's better to rephrase this part.
>
> `is_unsigned_v` is fine to me. No change requested for this.
Thanks! The trimmed description looks good to me.
And also, you're right that it's unclear whether such a signed user-defined `Rep` is even a valid `duration` representation. So I've softened that paragraph to no longer assert it's handled incorrectly.
Left the impl unchanged as suggested.
https://github.com/llvm/llvm-project/pull/209686
More information about the libcxx-commits
mailing list