This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Replace non-constexpr decrement in std::chrono::floor


Decrementing a duration is not constexpr (yet ... I made an NB comment
about it).

I'm not sure if these functions are correct for floating-point
durations, because we could end up with a duration which is very very
slightly lower of higher than the desired value, but then we subtract
1.0 from it. That's what the reference implementation in Howard's
proposal does, so I'll worry about it another day.

	* include/std/chrono (floor): Replace non-constexpr operation.
	* testsuite/20_util/duration_cast/rounding.cc: Test conversion to
	durations with floating pointer representations.

Tested powerpc64le-linux, committed to trunk.

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]