diff options
author | Kai Blaschke <kai.blaschke@kb-dev.net> | 2024-02-19 16:55:19 +0100 |
---|---|---|
committer | Kai Blaschke <kai.blaschke@kb-dev.net> | 2024-02-19 16:55:19 +0100 |
commit | 431a9c00a56cf4c603be1cf5f773b193621d8150 (patch) | |
tree | 95843aeea9fb6dc18279ee05ff6961f40b19798f /source/core/StarMaybe.hpp | |
parent | 30e1871d3f44629e00a1f66d8164e3e62c7f889f (diff) |
Fixed a huge amount of Clang warnings
On Linux and macOS, using Clang to compile OpenStarbound produces about 400 MB worth of warnings during the build, making the compiler output unreadable and slowing the build down considerably.
99% of the warnings were unqualified uses of std::move and std::forward, which are now all properly qualified.
Fixed a few other minor warnings about non-virtual destructors and some uses of std::move preventing copy elision on temporary objects.
Most remaining warnings are now unused parameters.
Diffstat (limited to 'source/core/StarMaybe.hpp')
-rw-r--r-- | source/core/StarMaybe.hpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/core/StarMaybe.hpp b/source/core/StarMaybe.hpp index 2b2b70d..2c53bcb 100644 --- a/source/core/StarMaybe.hpp +++ b/source/core/StarMaybe.hpp @@ -118,7 +118,7 @@ Maybe<T>::Maybe(T const& t) template <typename T> Maybe<T>::Maybe(T&& t) : Maybe() { - new (&m_data) T(forward<T>(t)); + new (&m_data) T(std::forward<T>(t)); m_initialized = true; } @@ -135,7 +135,7 @@ template <typename T> Maybe<T>::Maybe(Maybe&& rhs) : Maybe() { if (rhs.m_initialized) { - new (&m_data) T(move(rhs.m_data)); + new (&m_data) T(std::move(rhs.m_data)); m_initialized = true; rhs.reset(); } @@ -308,7 +308,7 @@ T Maybe<T>::take() { if (!m_initialized) throw InvalidMaybeAccessException(); - T val(move(m_data)); + T val(std::move(m_data)); reset(); @@ -318,7 +318,7 @@ T Maybe<T>::take() { template <typename T> bool Maybe<T>::put(T& t) { if (m_initialized) { - t = move(m_data); + t = std::move(m_data); reset(); @@ -335,7 +335,7 @@ void Maybe<T>::set(T const& t) { template <typename T> void Maybe<T>::set(T&& t) { - emplace(forward<T>(t)); + emplace(std::forward<T>(t)); } template <typename T> @@ -343,7 +343,7 @@ template <typename... Args> void Maybe<T>::emplace(Args&&... t) { reset(); - new (&m_data) T(forward<Args>(t)...); + new (&m_data) T(std::forward<Args>(t)...); m_initialized = true; } |