Is it possible to ensure copy elision?

前端 未结 3 2002
别跟我提以往
别跟我提以往 2021-01-18 03:58

Copy elision is a neat optimization technique and in some cases relying on copy elision can actually be faster than passing around references \"by hand\".

So, let\'s

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-18 04:39

    Not really, except putting an assert(false); in the copy constructor.

    Otherwise use your favorite profiler to measure that the interesting parts of your app is fast enough.

提交回复
热议问题