]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Define and use variable templates in <chrono>
authorJonathan Wakely <jwakely@redhat.com>
Thu, 22 Dec 2022 00:23:19 +0000 (00:23 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 22 Dec 2022 10:14:52 +0000 (10:14 +0000)
commitd2d3826cd4ba78a97a4906054262a9eb90abde1a
tree3a3b52359a5867fc7668ea2564dc1fd40d7fb7f9
parentec8f914f572ce45dbf5743c801c6a101e9a785c7
libstdc++: Define and use variable templates in <chrono>

Thi defines a variable template for the internal __is_duration helper
trait, defines a new __is_time_point_v variable template (to be used in
a subsequent commit), and adds explicit specializations of the standard
chrono::treat_as_floating_point trait for common types.

A fast path is added to chrono::duration_cast for the no-op case where
no conversion is needed.

Finally, some SFINAE constraints are simplified by using the
__enable_if_t alias, or by using variable templates.

libstdc++-v3/ChangeLog:

* include/bits/chrono.h (__is_duration_v, __is_time_point_v):
New variable templates.
(duration_cast): Add simplified definition for noconv case.
(treat_as_floating_point_v): Add explicit specializations.
(duration::operator%=, floor, ceil, round): Simplify SFINAE
constraints.
libstdc++-v3/include/bits/chrono.h
This page took 0.057274 seconds and 6 git commands to generate.