C++

This question already has an answer here:

  • Where and why do I have to put the “template” and “typename” keywords? 5 answers

  • Use typename here:

    typename vector<elemType>::const_iterator
    

    Because const_iterator is a dependent name (which is also shown in the error message). Search this site to know more about dependent-name.

    Better use auto and range-based for loop.

    链接地址: http://www.djcxy.com/p/37140.html

    上一篇: 在模板类定义下定义内联函数

    下一篇: C ++