Error calling template method in “templated-base-class”

前端 未结 1 1024
北荒
北荒 2021-01-14 09:12

The following code does not compile, why is that? And how can I fix this?

struct A{
    template int get() { return N; }
};

template 

        
1条回答
  •  囚心锁ツ
    2021-01-14 09:58

    you must disambiguate it, like so:

    templateint get() {
        return X::template get();
    }
    

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