There are no arguments that depend on a template parameter

前端 未结 6 1659
囚心锁ツ
囚心锁ツ 2020-12-04 19:13

I am trying to do the following:

template 
std::ifstream& operator>> (std::ifstream& fin, List l)
{
    T temp;
    l.r         


        
6条回答
  •  萌比男神i
    2020-12-04 19:41

    I've had the same problem and I've fixed it by changing include order.

    As phresnel says, the compiler cannot resolve that on the 1st phase, which in my case was because the header with the problematic template method was included before the one with the inner method that couldn't be resolved.

    Adding the needed header include removed the error for me. Hope this helps someone else.

提交回复
热议问题