1

クラスがあります

class A : public B
{
public:
    // 1st copy assignment with parameter pack
    template<class Arg>
    A& operator=(Arg&& arg)
    {
        B::operator=(std::forward<Args>(arg));
        return *this;
    }

    // 2nd copy assignment with const A&
    A& operator=(const A& arg)
    {
        // some code
    }
};

2番目のものは、次の場合は呼び出されません

A a, b;
a = b;

上記のコードの 2 番目のコンパイラを呼び出すにはどうすればよいですか?

4

0 に答える 0