diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2021-08-12 17:35:25 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-08-12 19:46:16 +0100 |
commit | 9017326e19fe278d5f62898cca4682b17f8e8e07 (patch) | |
tree | 4d52aa17bdb30c2ffe9889dd75668bd0287d1752 /gcc/tree-inline.c | |
parent | b1c0e8599aa6ff5550dc748679e13c1eb492ee2c (diff) | |
download | gcc-9017326e19fe278d5f62898cca4682b17f8e8e07.zip gcc-9017326e19fe278d5f62898cca4682b17f8e8e07.tar.gz gcc-9017326e19fe278d5f62898cca4682b17f8e8e07.tar.bz2 |
libstdc++: Add additional overload of std::lerp [PR101870]
The [cmath.syn] p1 wording about additional overloads sufficient to
handle any arithmetic types also applies to std::lerp. This adds a new
overload of std::lerp that does the required promotions to support
arguments of arbitrary arithmetic types.
A new __promoted_t alias template is added, which the C++17 function
templates std::hypot and std::lerp can use to avoid instantiating the
__promote_3 class template.
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:
PR libstdc++/101870
* include/c_global/cmath (hypot): Use __promoted_t.
(lerp): Add new overload accepting any arithmetic types.
* include/ext/type_traits.h (__promoted_t): New alias template.
* testsuite/26_numerics/lerp.cc: Moved to...
* testsuite/26_numerics/lerp/1.cc: ...here.
* testsuite/26_numerics/lerp/constexpr.cc: New test.
* testsuite/26_numerics/lerp/version.cc: New test.
Diffstat (limited to 'gcc/tree-inline.c')
0 files changed, 0 insertions, 0 deletions