“No matching function for call error” with g++

前端 未结 4 1449
悲&欢浪女
悲&欢浪女 2021-01-28 03:47

I have a class A

template
class A : public std::auto_ptr
{
    typedef std::auto_ptr Super;
public:
    A() : Super() { }
            


        
4条回答
  •  独厮守ぢ
    2021-01-28 04:26

    Without the exact code that actually causes the error it's hard to know for sure, but I suspect that from AIR::A::A(AIR::A&) what happening is you're trying to pass a temporary (possibly implicit) object into AIR::A::A and MSVC lets you bind the temporary to the non-const reference parameter, while g++ quite properly prohibits this. Can you make the parameter const?

提交回复
热议问题