mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-16 20:27:08 +03:00
book: typo fixes (#143)
This commit is contained in:
@@ -203,7 +203,7 @@ E.g:
|
||||
int main() {
|
||||
std::vector<int> vec = {1, 2, 3, 4};
|
||||
|
||||
// after c++17, can be simplefied by using `auto`
|
||||
// since c++17, can be simplified by using `auto`
|
||||
const std::vector<int>::iterator itr = std::find(vec.begin(), vec.end(), 2);
|
||||
if (itr != vec.end()) {
|
||||
*itr = 3;
|
||||
@@ -214,7 +214,7 @@ int main() {
|
||||
*itr = 4;
|
||||
}
|
||||
|
||||
// should output: 1, 4, 3, 4. can be simplefied using `auto`
|
||||
// should output: 1, 4, 3, 4. can be simplified using `auto`
|
||||
for (std::vector<int>::iterator element = vec.begin(); element != vec.end(); ++element)
|
||||
std::cout << *element << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user