回答編集履歴
1
fix code
answer
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
ちょっと(?)マニアックな例として、テンプレート派生クラス(`Derived<T>`)からテンプレート基底クラス(`Base <T>`)のメンバ関数(`f`)を呼び出したいとき、`this->f`のようにthisポインタを明示する必要があります。
|
2
2
|
|
3
|
-
Demo: [https://wandbox.org/permlink/
|
3
|
+
Demo: [https://wandbox.org/permlink/SB2IZKM0kpbyon9z](https://wandbox.org/permlink/SB2IZKM0kpbyon9z)
|
4
4
|
```C++
|
5
5
|
template<typename T>
|
6
6
|
struct Base {
|
@@ -18,6 +18,6 @@
|
|
18
18
|
|
19
19
|
int main()
|
20
20
|
{
|
21
|
-
|
21
|
+
Derived<int>{}.h();
|
22
22
|
}
|
23
23
|
```
|