On Wednesday, 31 May 2023 00:17:21 PDT Marc Mutz via Development wrote: > I doubt there's an accepted project-wide standard, yet, but as a rule of > thumb that everyone might be able to agree on: If the function doesn't > store the string as-is (=parses or pre-processes it), take by > QAnyStringView, otherwise continue to take by QString cref.
I want to be very clear on that: the function's *purpose* must be to parse the string in question and act on it immediately. It shouldn't be about what the implementation is currently, but about what the function is. It can't be a setter either (because there would be a getter). Therefore, if your function isn't named after a verb in the imperative, then it should be const QString &. -- Thiago Macieira - thiago.macieira (AT) intel.com Cloud Software Architect - Intel DCAI Cloud Engineering
smime.p7s
Description: S/MIME cryptographic signature
-- Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development