From 75c8e07cc386a41ee03c3d0a884deec3323a491c Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Wed, 31 May 2023 20:01:00 +0200 Subject: [PATCH] AK: Remove conditional `noexcept` from `Complex` C++11 has been a requirement for some time now, no need to bother the preprocessor with it. --- AK/Complex.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/AK/Complex.h b/AK/Complex.h index ece1770189..a7fd830093 100644 --- a/AK/Complex.h +++ b/AK/Complex.h @@ -9,10 +9,6 @@ #include #include -#ifdef __cplusplus -# if __cplusplus >= 201103L -# define COMPLEX_NOEXCEPT noexcept -# endif namespace AK { template @@ -36,18 +32,18 @@ public: { } - constexpr T real() const COMPLEX_NOEXCEPT { return m_real; } + constexpr T real() const noexcept { return m_real; } - constexpr T imag() const COMPLEX_NOEXCEPT { return m_imag; } + constexpr T imag() const noexcept { return m_imag; } - constexpr T magnitude_squared() const COMPLEX_NOEXCEPT { return m_real * m_real + m_imag * m_imag; } + constexpr T magnitude_squared() const noexcept { return m_real * m_real + m_imag * m_imag; } - constexpr T magnitude() const COMPLEX_NOEXCEPT + constexpr T magnitude() const noexcept { return hypot(m_real, m_imag); } - constexpr T phase() const COMPLEX_NOEXCEPT + constexpr T phase() const noexcept { return atan2(m_imag, m_real); } @@ -281,12 +277,10 @@ static constexpr Complex cexp(Complex const& a) } } -# if USING_AK_GLOBALLY +#if USING_AK_GLOBALLY using AK::approx_eq; using AK::cexp; using AK::Complex; using AK::complex_imag_unit; using AK::complex_real_unit; -# endif - #endif