设为首页 加入收藏

TOP

clang++ 优化返回代码(二)
2015-11-21 01:05:08 来源: 作者: 【 】 浏览:5
Tags:clang 优化 返回 代码
me situation as if you returned by lvalue-reference and removed the move from the return line: Either way you've got a dangling reference to a local variable inside the function and which has been destructed. – Howard Hinnant Feb 27 '13 at 16:11
1 upvote
? flag
Just a nit: Since you named the variable (tmp) in the Best practice section, it is the NRVO that kicks in, not the RVO. These are two different optimizations. Other than that, great answer! – Daniel Frey Feb

?

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇leetcode:Rotate List 下一篇UVA - 11464 - Even Parity

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: