C++11 introduced the ability to "ref-qualifier" methods. The most known qualifier is the const one:
however now is also possible to ref-qualify *this
let see how this can be of any use. Immagine to have a factory building heavy objects and
returning them by copy this way:
in the following scenario we can avoid an useless copy:
we can avoid the copy if Jumbo is movable overloading the method getJumboByCopy in case
the object on which I'm calling it is a temporary:
To be honest the example shows a scenario with other problems than the one mentioned (for instance
if the object Jumbo is so big why permitting the copy then?) but I hope you got the idea.
5 comments:
Thanks for your ideas. You can also find the details on Affity Solutions, at the C++ Development. The main object of the Affity Solutions is to provide quality web services and is among the few software development company in Nagpur.
N FOLL-BACK
I http://hollosys.blogspot.com/
C
E ARTIKEL
Informative post. Thanks for sharing.
C++ Urdu Tutorial
Tula's International School Best Boarding School in Dehradun
Tula's International School Best Boarding School in Dehradun
Tula's International School Co-ed Boarding School in Dehradun
Tula's International School Best Residential School in Dehradun
Tula's International School Dehradun Boarding School Fee structure
Tula's International School Top Girls Boarding School India
Tula's International School Best CBSE Schools in Uttarakhand
Tula's International School Top Boarding Schools in India
Tula's International School MCA College in Dehradun
Tula's Institute Best Private BJMC College in Dehradun
https://www.vishalbhardwaj.com/2020/07/Commerce-Business-Administration.html
https://www.vishalbhardwaj.com/2020/07/Commerce-Notes.html
https://www.vishalbhardwaj.com/2020/06/what-is-data-structure.html
https://www.vishalbhardwaj.com/2020/07/CPP-in-Hindi.html
Post a Comment