Question about vector iterator in template functions

后端 未结 5 1767
慢半拍i
慢半拍i 2020-12-24 07:54

I\'m trying to learn the STL library and I\'m having a weird problem. This code compiles perfectly:

void Show(vector myvec)
{
    vector

        
5条回答
  •  臣服心动
    2020-12-24 08:49

    In the first instance the parameter, although it uses a template, is not a template, it is a fully defined class (vector)

    In the latter instance the parameter is a template on type T and thus requires typename

提交回复
热议问题