diff mbox series

Add 'noexcept' to std::lerp

Message ID 20190617143718.GA12469@redhat.com
State New
Headers show
Series Add 'noexcept' to std::lerp | expand

Commit Message

Jonathan Wakely June 17, 2019, 2:37 p.m. UTC
* include/c_global/cmath (__lerp, lerp): Add noexcept (LWG 3201).

Tested x86_64-linux, committed to trunk.
commit 4b48ab1965d6d690f6b6b0bb55f48149d1cbbb25
Author: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Mon Jun 17 14:32:44 2019 +0000

    Add 'noexcept' to std::lerp
    
            * include/c_global/cmath (__lerp, lerp): Add noexcept (LWG 3201).
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272386 138bc75d-0d04-0410-961f-82ee72b054a4
diff mbox series

Patch

diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath
index b843c18f1da..01e56a559fe 100644
--- a/libstdc++-v3/include/c_global/cmath
+++ b/libstdc++-v3/include/c_global/cmath
@@ -1891,7 +1891,7 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   template<typename _Fp>
     constexpr _Fp
-    __lerp(_Fp __a, _Fp __b, _Fp __t)
+    __lerp(_Fp __a, _Fp __b, _Fp __t) noexcept
     {
       if (__a <= 0 && __b >= 0 || __a >= 0 && __b <= 0)
 	return __t * __b + (1 - __t) * __a;
@@ -1908,15 +1908,15 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
   constexpr float
-  lerp(float __a, float __b, float __t)
+  lerp(float __a, float __b, float __t) noexcept
   { return std::__lerp(__a, __b, __t); }
 
   constexpr double
-  lerp(double __a, double __b, double __t)
+  lerp(double __a, double __b, double __t) noexcept
   { return std::__lerp(__a, __b, __t); }
 
   constexpr long double
-  lerp(long double __a, long double __b, long double __t)
+  lerp(long double __a, long double __b, long double __t) noexcept
   { return std::__lerp(__a, __b, __t); }
 #endif // C++20