Fix performance-noexcept-move-constructor clang-tidy warning (#6933)
This commit is contained in:
committed by
GitHub
parent
c57b0d28b0
commit
8fd8d0c24a
@@ -12,7 +12,7 @@ struct header
|
||||
// explicitly use default copy c'tor as adding move c'tor
|
||||
header &operator=(const header &other) = default;
|
||||
header(std::string name, std::string value) : name(std::move(name)), value(std::move(value)) {}
|
||||
header(header &&other) : name(std::move(other.name)), value(std::move(other.value)) {}
|
||||
header(header &&other) noexcept : name(std::move(other.name)), value(std::move(other.value)) {}
|
||||
|
||||
void clear()
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ struct ConcurrentIDMap
|
||||
mutable UpgradableMutex mutex;
|
||||
|
||||
ConcurrentIDMap() = default;
|
||||
ConcurrentIDMap(ConcurrentIDMap &&other)
|
||||
ConcurrentIDMap(ConcurrentIDMap &&other) noexcept
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
@@ -36,7 +36,7 @@ struct ConcurrentIDMap
|
||||
data = std::move(other.data);
|
||||
}
|
||||
}
|
||||
ConcurrentIDMap &operator=(ConcurrentIDMap &&other)
|
||||
ConcurrentIDMap &operator=(ConcurrentIDMap &&other) noexcept
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
|
||||
@@ -204,8 +204,8 @@ template <typename ElementT> class DeallocatingVector
|
||||
}
|
||||
|
||||
// moving is fine
|
||||
DeallocatingVector(DeallocatingVector &&other) { swap(other); }
|
||||
DeallocatingVector &operator=(DeallocatingVector &&other)
|
||||
DeallocatingVector(DeallocatingVector &&other) noexcept { swap(other); }
|
||||
DeallocatingVector &operator=(DeallocatingVector &&other) noexcept
|
||||
{
|
||||
swap(other);
|
||||
return *this;
|
||||
|
||||
@@ -154,7 +154,7 @@ template <typename EdgeDataT> class DynamicGraph
|
||||
return *this;
|
||||
}
|
||||
|
||||
DynamicGraph(DynamicGraph &&other)
|
||||
DynamicGraph(DynamicGraph &&other) noexcept
|
||||
{
|
||||
number_of_nodes = other.number_of_nodes;
|
||||
// atomics can't be moved this is why we need an own constructor
|
||||
@@ -164,7 +164,7 @@ template <typename EdgeDataT> class DynamicGraph
|
||||
edge_list = std::move(other.edge_list);
|
||||
}
|
||||
|
||||
DynamicGraph &operator=(DynamicGraph &&other)
|
||||
DynamicGraph &operator=(DynamicGraph &&other) noexcept
|
||||
{
|
||||
number_of_nodes = other.number_of_nodes;
|
||||
// atomics can't be moved this is why we need an own constructor
|
||||
|
||||
Reference in New Issue
Block a user