Re:Pass-by-value vs. pass-by-reference-to-const in C++
by saagarjha on Friday March 27, 2020 @02:43AM
(#22700839)
> there is nothing to stop someone from adding to Widget until it crosses the threshold of "expensive"
Generally, things that are passed by value are de-facto “frozen” and will not have new members added to them, as they’d no longer be “zero cost”. For example, std:string::iterator is “logically” a char * and this will likely never change.
Generally, things that are passed by value are de-facto “frozen” and will not have new members added to them, as they’d no longer be “zero cost”. For example, std:string::iterator is “logically” a char * and this will likely never change.