Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
pezy committed Dec 24, 2014
2 parents a967db5 + 28593d0 commit e3243e5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ch09/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ const vector<int> v2;
auto it1 = v1.begin(), it2 = v2.begin();
auto it3 = v1.cbegin(), it4 = v2.cbegin();
```
In gcc 4.8, will report error:
error: inconsistent deduction for ‘auto’: ‘__gnu_cxx::__normal_iterator<int*, std::vector<int> >’ and then ‘__gnu_cxx::__normal_iterator<const int*, std::vector<int> >’ auto it1 = v1.begin(), it2 = v2.begin();
the correct code should be
auto it1 = v1.begin();
auto it2 = v2.begin(), it3 = v1.cbegin(), it4 = v2.cbegin();

-----

Expand Down

0 comments on commit e3243e5

Please sign in to comment.