[mythtv] QString: pass by const& or value?

Scott T scott.the.elm at gmail.com
Thu Oct 21 04:45:29 UTC 2021

Is it necessary to pass QString by const reference?  Specifically I'm 
looking at libmythmetadata/videometadata (converting to non-PIMPL) and 
libmyth/programinfo (some unchanged by 

If I understand correctly, passing by value increments the reference 
counter before the function call, and then using std::move just moves 
the (pointer to the) data.  Thus, passing by value is recommended for 

Should other functions also be passed by value, due to Qt’s implicit 
sharing?  Should QStrings be returned from a function by value or const 
reference as many are in videometadata?


More information about the mythtv-dev mailing list