C++ overloading operator comma for variadic arguments

前端 未结 4 633
终归单人心
终归单人心 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:52

    No, it isn't. The list of values separated by the comma operator will be evaluated as a single value. For example:

    1,2,3
    

    will result in a single value, 3.

提交回复
热议问题