From what I gather, functions return temporaries which don't need to be const (I assume making it const would use more processing) except for cases where returns are pointers or references.
I have no problem understanding why pointers would warrant such sensitivity. It's a common algorithm to move a pointer instead of calculating the new position from the start every-time. So just as easily as they can moved appropriately, they can be moved inappropriately.
Where I don't understand is the supposed need to make references const, I thought references were basically pointers that couldn't change once initiated and were required to be initiated. If something can't be change inherently, where's the need to repeat the requirement (and add processing) ?
Thanks
Sorry if I'm duplicating an issue, I couldn't find one alike with the search results I got from
Note that choosing a differently using the Keyword drop-down (Search Entire Posts / Search Titles Only) display the same exact search characteristics (what I'm calling what's quoted).Type: Posts; Keyword(s): return const; Forum = C++ Programming and child forums
Type: Posts; Keyword(s): return+const; Forum = C++ Programming and child forums
Type: Posts; Keyword(s): return AND const; Forum = C++ Programming and child forums