mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 12:44:42 +03:00
committed by
Sergey Zubkov
parent
29dedc49af
commit
6c92f514f4
@@ -5808,11 +5808,11 @@ But what if you can get significantly better performance by not making a tempora
|
|||||||
{
|
{
|
||||||
if (a.sz > sz) {
|
if (a.sz > sz) {
|
||||||
// ... use the swap technique, it can't be bettered ...
|
// ... use the swap technique, it can't be bettered ...
|
||||||
return *this
|
return *this;
|
||||||
}
|
}
|
||||||
// ... copy sz elements from *a.elem to elem ...
|
// ... copy sz elements from *a.elem to elem ...
|
||||||
if (a.sz < sz) {
|
if (a.sz < sz) {
|
||||||
// ... destroy the surplus elements in *this* and adjust size ...
|
// ... destroy the surplus elements in *this and adjust size ...
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user