Keyword 'template' confuses MSVC

后端 未结 1 1558
孤独总比滥情好
孤独总比滥情好 2020-12-20 18:56

One of those \"which compiler is right\" questions about templates. Consider following:

template
class Container
{
public:
    template<         


        
相关标签:
1条回答
  • 2020-12-20 19:07

    You can simplify code by using trailing return type. No need for typename or template:

    template<typename T>
    template<typename V>
    auto Container<T>::iterator<V>::operator++() -> iterator<V> &
    {
        //do your thing
        return *this;
    }
    

    online compiler

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