Copy constructor not called?

前端 未结 2 534
悲哀的现实
悲哀的现实 2020-12-06 15:57

As far as I know you call the copy constructor in the following cases:
1 When instantiating one object and initializing it with values from another object
2 When pas

2条回答
  •  伪装坚强ぢ
    2020-12-06 16:24

    Because of Return Value Optimization the 3rd test case's copy constructor call is optimized away by the compiler.

提交回复
热议问题