C++: returning by reference and copy constructors

后端 未结 9 1816
伪装坚强ぢ
伪装坚强ぢ 2020-12-09 09:46

References in C++ are baffling me. :)

The basic idea is that I\'m trying to return an object from a function. I\'d like to do it without returning a pointer (because

9条回答
  •  情话喂你
    2020-12-09 10:06

    read about RVO and NRVO (in a word these two stands for Return Value Optimization and Named RVO, and are optimization techniques used by the compiler to do what you're trying to achieve)

    you'll find a lot of subjects here on stackoverflow

提交回复
热议问题