💚 fix Clang-Tidy warnings

This commit is contained in:
Niels Lohmann 2023-06-06 20:00:22 +02:00
parent a0c1318830
commit 682998faf6
No known key found for this signature in database
GPG Key ID: 7F3CEA63AE251B69
4 changed files with 15 additions and 15 deletions

View File

@ -69,10 +69,10 @@ template<typename IteratorType> class iteration_proxy_value
// older GCCs are a bit fussy and require explicit noexcept specifiers on defaulted functions // older GCCs are a bit fussy and require explicit noexcept specifiers on defaulted functions
iteration_proxy_value(iteration_proxy_value&&) iteration_proxy_value(iteration_proxy_value&&)
noexcept(std::is_nothrow_move_constructible<IteratorType>::value noexcept(std::is_nothrow_move_constructible<IteratorType>::value
&& std::is_nothrow_move_constructible<string_type>::value) = default; && std::is_nothrow_move_constructible<string_type>::value) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor)
iteration_proxy_value& operator=(iteration_proxy_value&&) iteration_proxy_value& operator=(iteration_proxy_value&&)
noexcept(std::is_nothrow_move_assignable<IteratorType>::value noexcept(std::is_nothrow_move_assignable<IteratorType>::value
&& std::is_nothrow_move_assignable<string_type>::value) = default; && std::is_nothrow_move_assignable<string_type>::value) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor)
~iteration_proxy_value() = default; ~iteration_proxy_value() = default;
/// dereference operator (needed for range-based for) /// dereference operator (needed for range-based for)

View File

@ -122,7 +122,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
{ {
for (auto it = this->begin(); it != this->end(); ++it) for (auto it = this->begin(); it != this->end(); ++it)
{ {
if (m_compare(it->first, key)) if (m_compare(it->first, std::forward<KeyType>(key)))
{ {
return it->second; return it->second;
} }
@ -150,7 +150,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
{ {
for (auto it = this->begin(); it != this->end(); ++it) for (auto it = this->begin(); it != this->end(); ++it)
{ {
if (m_compare(it->first, key)) if (m_compare(it->first, std::forward<KeyType>(key)))
{ {
return it->second; return it->second;
} }
@ -184,7 +184,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
{ {
for (auto it = this->begin(); it != this->end(); ++it) for (auto it = this->begin(); it != this->end(); ++it)
{ {
if (m_compare(it->first, key)) if (m_compare(it->first, std::forward<KeyType>(key)))
{ {
// Since we cannot move const Keys, re-construct them in place // Since we cannot move const Keys, re-construct them in place
for (auto next = it; ++next != this->end(); ++it) for (auto next = it; ++next != this->end(); ++it)
@ -275,7 +275,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
{ {
for (auto it = this->begin(); it != this->end(); ++it) for (auto it = this->begin(); it != this->end(); ++it)
{ {
if (m_compare(it->first, key)) if (m_compare(it->first, std::forward<KeyType>(key)))
{ {
return 1; return 1;
} }
@ -301,7 +301,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
{ {
for (auto it = this->begin(); it != this->end(); ++it) for (auto it = this->begin(); it != this->end(); ++it)
{ {
if (m_compare(it->first, key)) if (m_compare(it->first, std::forward<KeyType>(key)))
{ {
return it; return it;
} }

View File

@ -5151,10 +5151,10 @@ template<typename IteratorType> class iteration_proxy_value
// older GCCs are a bit fussy and require explicit noexcept specifiers on defaulted functions // older GCCs are a bit fussy and require explicit noexcept specifiers on defaulted functions
iteration_proxy_value(iteration_proxy_value&&) iteration_proxy_value(iteration_proxy_value&&)
noexcept(std::is_nothrow_move_constructible<IteratorType>::value noexcept(std::is_nothrow_move_constructible<IteratorType>::value
&& std::is_nothrow_move_constructible<string_type>::value) = default; && std::is_nothrow_move_constructible<string_type>::value) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor)
iteration_proxy_value& operator=(iteration_proxy_value&&) iteration_proxy_value& operator=(iteration_proxy_value&&)
noexcept(std::is_nothrow_move_assignable<IteratorType>::value noexcept(std::is_nothrow_move_assignable<IteratorType>::value
&& std::is_nothrow_move_assignable<string_type>::value) = default; && std::is_nothrow_move_assignable<string_type>::value) = default; // NOLINT(hicpp-noexcept-move,performance-noexcept-move-constructor)
~iteration_proxy_value() = default; ~iteration_proxy_value() = default;
/// dereference operator (needed for range-based for) /// dereference operator (needed for range-based for)
@ -19040,7 +19040,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
{ {
for (auto it = this->begin(); it != this->end(); ++it) for (auto it = this->begin(); it != this->end(); ++it)
{ {
if (m_compare(it->first, key)) if (m_compare(it->first, std::forward<KeyType>(key)))
{ {
return it->second; return it->second;
} }
@ -19068,7 +19068,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
{ {
for (auto it = this->begin(); it != this->end(); ++it) for (auto it = this->begin(); it != this->end(); ++it)
{ {
if (m_compare(it->first, key)) if (m_compare(it->first, std::forward<KeyType>(key)))
{ {
return it->second; return it->second;
} }
@ -19102,7 +19102,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
{ {
for (auto it = this->begin(); it != this->end(); ++it) for (auto it = this->begin(); it != this->end(); ++it)
{ {
if (m_compare(it->first, key)) if (m_compare(it->first, std::forward<KeyType>(key)))
{ {
// Since we cannot move const Keys, re-construct them in place // Since we cannot move const Keys, re-construct them in place
for (auto next = it; ++next != this->end(); ++it) for (auto next = it; ++next != this->end(); ++it)
@ -19193,7 +19193,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
{ {
for (auto it = this->begin(); it != this->end(); ++it) for (auto it = this->begin(); it != this->end(); ++it)
{ {
if (m_compare(it->first, key)) if (m_compare(it->first, std::forward<KeyType>(key)))
{ {
return 1; return 1;
} }
@ -19219,7 +19219,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
{ {
for (auto it = this->begin(); it != this->end(); ++it) for (auto it = this->begin(); it != this->end(); ++it)
{ {
if (m_compare(it->first, key)) if (m_compare(it->first, std::forward<KeyType>(key)))
{ {
return it; return it;
} }

View File

@ -24,7 +24,7 @@ struct bad_allocator : std::allocator<T>
template<class U> bad_allocator(const bad_allocator<U>& /*unused*/) { } template<class U> bad_allocator(const bad_allocator<U>& /*unused*/) { }
template<class... Args> template<class... Args>
void construct(T* /*unused*/, Args&& ... /*unused*/) void construct(T* /*unused*/, Args&& ... /*unused*/) // NOLINT(cppcoreguidelines-missing-std-forward)
{ {
throw std::bad_alloc(); throw std::bad_alloc();
} }