Member template in local class

天涯浪子 提交于 2019-11-29 05:23:59

The purpose of this limitation? Just a guess, but:

  • you may use the template class/template member function only within the enclosing function. Therefore you already know all used types within the function and hence can directly specify the used types (for several types, of course, the template variant would have saved some typing).
  • although it might not seem so, it is work for all compiler creators and space for bugs and so it must be worth the effort.

Fun Fact: Try to use a local class within a function as a return type for a (c++0x)-lambda function declared in the function: MSVC 2010: internal compiler error ^^.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!