[Bug libstdc++/101870] std::lerp is missing Arithmetic overloads

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon May 9 16:40:16 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101870

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:5ed333b0762d847ffb0096ba97e924188c766d69

commit r9-10059-g5ed333b0762d847ffb0096ba97e924188c766d69
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Aug 12 17:35:25 2021 +0100

    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.

    (cherry picked from commit 9017326e19fe278d5f62898cca4682b17f8e8e07)


More information about the Gcc-bugs mailing list