C++ Using stringstream after << as parameter

后端 未结 5 1561
Happy的楠姐
Happy的楠姐 2021-01-02 19:20

Is it possible to write a method that takes a stringstream and have it look something like this,

void method(string st         


        
5条回答
  •  情话喂你
    2021-01-02 20:16

    Since you know you've got a stringstream, just cast the return value:

    stringstream var;
    printStringStream(static_cast(var << whatever));
    

提交回复
热议问题