加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c – 有没有办法std ::将std :: string转换成std :: stringstrea

发布时间:2020-12-16 05:28:02 所属栏目:百科 来源:网络整理
导读:在c引用中,我没有看到std :: stringstream构造函数接受std :: string的rvalue引用.有没有任何其他帮助功能将字符串移动到stringstream没有开销,还是有特别的理由背后这样的限制? 解决方法 I do not see a std::stringstream constructor accepting rvalue r
在c引用中,我没有看到std :: stringstream构造函数接受std :: string的rvalue引用.有没有任何其他帮助功能将字符串移动到stringstream没有开销,还是有特别的理由背后这样的限制?

解决方法

I do not see a std::stringstream constructor accepting rvalue reference of std::string

那就对了.即使是str设置器也没有使用移动语义,所以将字符串移动到stringstream是不可能的(不是在当前的标准,但希望在将来).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读