Type not found when derived from template base class

后端 未结 1 1511
萌比男神i
萌比男神i 2021-01-15 18:53

I\'m having difficulty understanding why there is a difference in the following two pieces of code, what exactly is the compiler doing.

I have the following bit of t

相关标签:
1条回答
  • 2021-01-15 19:00

    In the second version, booboo is a dependent name, so it is not automatically visible in the template. You can either add using typename base<T>::booboo; to the derived class, or use your typedef solution, or say typename base<T>::booboo bb = T(1);.

    0 讨论(0)
提交回复
热议问题