joe*_*els 1 c++ string
string str1("someString"); string str2 = string(str1);//how many copies are made here //copy2 = copy1?
当您使用字符串(otherString)分配字符串时,是否会复制括号中的值,然后将该值复制到变量中?
Dav*_*eas 9
从技术上讲,可以有两个副本,但在现实生活中,你只做一个副本.也就是说,编译器将意识到不需要临时文件并优化掉副本.
归档时间:
13 年,10 月 前
查看次数:
92 次
最近记录: