我需要经常将字符串设为空,然后在其中附加一些字符。std::string::clear() 可能会重新分配 std::string::resize(0) 会重新分配吗?标准的话没有对此做出任何保证。
c++ string resize
c++ ×1
resize ×1
string ×1