teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

追記

2020/09/26 08:34

投稿

Chironian
Chironian

スコア23274

answer CHANGED
@@ -14,4 +14,19 @@
14
14
  using std::map<int, MapA*>::map;
15
15
  };
16
16
  ```
17
- [wandbox](https://wandbox.org/permlink/Il71dOufZ3XQ36x9)
17
+ [wandbox](https://wandbox.org/permlink/Il71dOufZ3XQ36x9)
18
+
19
+ ---
20
+ 【追記】
21
+ イテレータへの応用です。(typedefを使って、綺麗にかけそうな気もするのですが思いつかない。)
22
+ ```
23
+ struct IteratorB;
24
+ struct IteratorA : public std::map<int, IteratorB*>::iterator
25
+ {
26
+ using std::map<int, IteratorB*>::iterator::iterator;
27
+ };
28
+ struct IteratorB : public std::map<int, IteratorA*>::iterator
29
+ {
30
+ using std::map<int, IteratorA*>::iterator::iterator;
31
+ };
32
+ ```