Skip to content

Commit e58b7fc

Browse files
committed
Merge pull request cpp-best-practices#5 from richerlariviere/master
Typo with Initializer Lists
2 parents d3b9e8c + 9c3d78d commit e58b7fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

07-Considering_Performance.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ auto mos = std::vector<ModelObject>{mo1, mo2};
9696
```c++
9797
// Don't do this
9898
std::vector<ModelObject> mos;
99-
mo.push_back(mo1);
100-
mo.push_back(mo2);
99+
mos.push_back(mo1);
100+
mos.push_back(mo2);
101101
```
102102

103103
Initializer lists are significantly more efficient; reducing object copies and resizing of containers

0 commit comments

Comments
 (0)