1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-15 03:48:02 +08:00

cmList: fix swap function definition

swap function should be in the same namespace as the cmList class.

Reported by https://pvs-studio.com/en/blog/posts/cpp/1277/ (N1)

Issue: #27159
This commit is contained in:
Marc Chevrier
2025-08-21 17:02:39 +02:00
parent d296bf6b70
commit 071e8678de

View File

@@ -1319,12 +1319,10 @@ inline std::vector<std::string>& operator+=(std::vector<std::string>& l,
return l; return l;
} }
namespace std {
inline void swap(cmList& lhs, cmList& rhs) noexcept inline void swap(cmList& lhs, cmList& rhs) noexcept
{ {
lhs.swap(rhs); lhs.swap(rhs);
} }
} // namespace std
namespace cm { namespace cm {
inline void erase(cmList& list, std::string const& value) inline void erase(cmList& list, std::string const& value)