C++ Logo

std-discussion

Advanced search

Re: Negative durations

From: Thiago Macieira <thiago_at_[hidden]>
Date: Thu, 21 Aug 2025 11:05:36 -0700
On Thursday, 21 August 2025 10:53:14 Pacific Daylight Time Alexander N. Savin
via Std-Discussion wrote:
> I would prefer duration_cast to use a mathematical floor rather than
> truncate for negative values. What do you think?

If you want that, use std::chrono::floor().

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Platform & System Engineering

Received on 2025-08-21 18:05:49