Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/Mooophy/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
psigillito committed Apr 19, 2016
2 parents 64869b6 + 60875a8 commit 94aa784
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions ch11/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,7 @@ const string& transform(const string &s, const map<string, string> &m)
return m[s];
}
```
Such code could be explained as following pseudocode:
```python
if m contains key s:
return m[s]
else:
insert pair {s, ""} into m
return m[s] // That is an empty string
```
The above code won't compile because the subscript operator might insert an element (when the element with the key s is not found), and we may use subscript only on a map that is not const.
## Exercise 11.35:
>In buildMap, what effect, if any, would there be from rewriting `trans_map[key] = value.substr(1);` as `trans_map.insert({ key, value.substr(1) })`?
Expand Down
2 changes: 1 addition & 1 deletion ch13/ex13_17_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class numbered {
static int unique;
};

static int unique = 10;
int numbered::unique = 10;

void f(numbered s) {
std::cout << s.mysn << std::endl;
Expand Down

0 comments on commit 94aa784

Please sign in to comment.