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
https://github.com/MythTV/mythtv/commit/1a8097e3249a8ed2ea051056da08a35993bdc953
)
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
constructors.
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?
Thanks,
Scott
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
looking at libmythmetadata/videometadata (converting to non-PIMPL) and
libmyth/programinfo (some unchanged by
https://github.com/MythTV/mythtv/commit/1a8097e3249a8ed2ea051056da08a35993bdc953
)
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
constructors.
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?
Thanks,
Scott
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org