c++: when to use pointers?

后端 未结 14 1734
无人共我
无人共我 2020-12-12 22:48

After reading some tutorials I came to the conclusion that one should always use pointers for objects. But I have also seen a few exceptions while reading some QT tutorials

14条回答
  •  甜味超标
    2020-12-12 23:50

    Pass by value with well behaved copyable objects is the way to go for a large amount of your code.

    If speed really matters, use pass by reference where you can, and finally use pointers.

提交回复
热议问题