aboutsummaryrefslogtreecommitdiff
path: root/src/prevector.h
diff options
context:
space:
mode:
authorMartin Leitner-Ankerl <martin.ankerl@gmail.com>2023-03-26 15:39:20 +0200
committerMartin Leitner-Ankerl <martin.ankerl@gmail.com>2023-03-26 15:49:52 +0200
commit81f67977f543faca2dcc35846f73e2917375ae79 (patch)
tree14b0cd455a2fcb53a2dc5665ec881cbec8cbd34b /src/prevector.h
parentd380d2877ed45cf1e75a87d822b30e4e1e21e3d4 (diff)
util: prevector's move ctor and move assignment is `noexcept`
Move operations already are `noexcept`, so add the keyword to the methods. This makes the `PrevectorFillVectorIndirect...` benchmarks about twice as fast on my machine, because otherwise `std::vector` has to use a copy when the vector resizes.
Diffstat (limited to 'src/prevector.h')
-rw-r--r--src/prevector.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/prevector.h b/src/prevector.h
index f36cfe4ff6..d3e4b8fd0d 100644
--- a/src/prevector.h
+++ b/src/prevector.h
@@ -264,7 +264,7 @@ public:
fill(item_ptr(0), other.begin(), other.end());
}
- prevector(prevector<N, T, Size, Diff>&& other) {
+ prevector(prevector<N, T, Size, Diff>&& other) noexcept {
swap(other);
}
@@ -276,7 +276,7 @@ public:
return *this;
}
- prevector& operator=(prevector<N, T, Size, Diff>&& other) {
+ prevector& operator=(prevector<N, T, Size, Diff>&& other) noexcept {
swap(other);
return *this;
}