我只想知道我们是否可以给运算符<<的重载提供两个或更多参数
一个例子将更明确:
anyType operator<<(arg p1, arg p2)
{
DoSomethingWith(p1);
DoSomethingWith(p2);
return (*this);
}
Run Code Online (Sandbox Code Playgroud)
并像这样使用它:
anyVar << anyVar2, anyVar3;
Run Code Online (Sandbox Code Playgroud)