Commit 360a758e by Jonathan Wakely Committed by Jonathan Wakely

Add 'noexcept' to std::lerp

	* include/c_global/cmath (__lerp, lerp): Add noexcept (LWG 3201).

From-SVN: r272386
parent 26b1320e
2019-06-17 Jonathan Wakely <jwakely@redhat.com> 2019-06-17 Jonathan Wakely <jwakely@redhat.com>
* include/c_global/cmath (__lerp, lerp): Add noexcept (LWG 3201).
PR libstdc++/90281 Fix string conversions for filesystem::path PR libstdc++/90281 Fix string conversions for filesystem::path
* include/bits/fs_path.h (u8path) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: * include/bits/fs_path.h (u8path) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]:
Use codecvt_utf8_utf16 instead of codecvt_utf8. Use Use codecvt_utf8_utf16 instead of codecvt_utf8. Use
......
...@@ -1891,7 +1891,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1891,7 +1891,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Fp> template<typename _Fp>
constexpr _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) if (__a <= 0 && __b >= 0 || __a >= 0 && __b <= 0)
return __t * __b + (1 - __t) * __a; return __t * __b + (1 - __t) * __a;
...@@ -1908,15 +1908,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1908,15 +1908,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
constexpr float constexpr float
lerp(float __a, float __b, float __t) lerp(float __a, float __b, float __t) noexcept
{ return std::__lerp(__a, __b, __t); } { return std::__lerp(__a, __b, __t); }
constexpr double constexpr double
lerp(double __a, double __b, double __t) lerp(double __a, double __b, double __t) noexcept
{ return std::__lerp(__a, __b, __t); } { return std::__lerp(__a, __b, __t); }
constexpr long double 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); } { return std::__lerp(__a, __b, __t); }
#endif // C++20 #endif // C++20
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment