Skip to content

Commit

Permalink
update(cpp-stl): usage of unordered_map
Browse files Browse the repository at this point in the history
issue #104
  • Loading branch information
sabertazimi committed Nov 23, 2018
1 parent e9b3c88 commit f218918
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions language/cpp/cppBasicNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
- [Input Output](#input-output)
- [iomanip STL API](#iomanip-stl-api)
- [Container](#container)
- [unordered_map container](#unordered_map-container)
- [Container Choosing](#container-choosing)
- [empty/size](#emptysize)
- [assign/insert/erase](#assigninserterase)
Expand Down Expand Up @@ -837,6 +838,20 @@ int main() {
- 连续内存容器: vector string deque
- 链表容器: list slit hash

#### unordered_map container

- count/find
- `[]`

```cpp
if (m_breakpoints.count(possible_breakpoint_location)) {
auto& bp = m_breakpoints[possible_breakpoint_location];
}

auto alias = m_aliases.find(input);
return (alias != m_aliases.end() && alias->second == command);
```

#### Container Choosing

- Vector vs Array:
Expand Down

0 comments on commit f218918

Please sign in to comment.