C++ Logo

std-discussion

Advanced search

std::chrono: intend of op-/ for std:.chrono::day

From: Wilhelm Meier <wilhelm.meier_at_[hidden]>
Date: Thu, 16 Jan 2020 15:50:09 +0100
Hi all,

just stumbled across the following:

    auto t1 = 12s / 3;
    auto t2 = 12d / 3;

t1 gives a duration of 3 seconds (reasonable, but t2 gives 12th of march.

Is this intentional?

I know, that 12s is a duration, and 12d is a timepoint. But for the
careless reader, this is counter-intuitive.

Received on 2020-01-16 08:52:49