C++ overloading operator comma for variadic arguments

前端 未结 4 618
终归单人心
终归单人心 2021-01-02 17:52

is it possible to construct variadic arguments for function by overloading operator comma of the argument? i want to see an example how to do so.., maybe something like this

4条回答
  •  鱼传尺愫
    2021-01-02 18:34

    Operators have a fixed number of parameters. You cannot change that. The comma operator takes two arguments. So no. You can roll a custom, cascading version though, with some effort.

提交回复
热议问题