Skip to content

Commit 81f6797

Browse files
committed
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.
1 parent d380d28 commit 81f6797

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/prevector.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class prevector {
264264
fill(item_ptr(0), other.begin(), other.end());
265265
}
266266

267-
prevector(prevector<N, T, Size, Diff>&& other) {
267+
prevector(prevector<N, T, Size, Diff>&& other) noexcept {
268268
swap(other);
269269
}
270270

@@ -276,7 +276,7 @@ class prevector {
276276
return *this;
277277
}
278278

279-
prevector& operator=(prevector<N, T, Size, Diff>&& other) {
279+
prevector& operator=(prevector<N, T, Size, Diff>&& other) noexcept {
280280
swap(other);
281281
return *this;
282282
}

0 commit comments

Comments
 (0)