using op= instead of stand-alone op.(More Effective C++)

All this talk of named objects, unnamed objects, and compiler optimizations is interesting, but let us not forget the big picture. The big picture is that assignment versions of operators (such as operator+=) tend to be more efficient than stand-alone versions of those operators (e.g. operator+). As a library designer, you should offer both, and as an application developer, you should consider using assignment versions of operators instead of stand-alone versions whenever performance is at a premium. 

原文链接: https://www.cnblogs.com/zhtf2014/archive/2012/03/12/2391739.html

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍

    using op= instead of stand-alone op.(More Effective C++)

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/43985

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年2月8日 下午8:38
下一篇 2023年2月8日 下午8:40

相关推荐