当前位置:网站首页>What methods are called behind the use of objects

What methods are called behind the use of objects

2022-07-23 14:51:00 Invincible Dragon Warrior

What methods are called behind the use of objects

  • During the transfer of function parameters , Objects are passed by reference first , Don't pass by value .( Reduce the construction and destruction of formal parameter objects )
  • When the function returns an object , A zero hour object should be returned first , Instead of returning a defined object
     Insert picture description here
  • When accepting a function call whose return value is an object , Accept preferentially in the way of initialization , Don't accept in the way of assignment .
     Insert picture description here

 Insert picture description here
 Insert picture description here
The pointer is not secure , But references can .
 Insert picture description here
Cannot return a pointer or reference to a local or temporary object

原网站

版权声明
本文为[Invincible Dragon Warrior]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207230847077503.html