[Development] QStringLiteral vs QLatin1String , foreach vs for range

Kevin Kofler kevin.kofler at chello.at
Wed Jan 20 05:20:36 CET 2016


Thiago Macieira wrote:
> foreach copies; ranged for doesn't.

… unless you try to use it on a non-const Qt container with usage count >1, 
then it will even deep-copy (detach) it! (I know you know this, but you 
should warn people about it.) So you need to be very careful about what you 
pass to ranged for.

        Kevin Kofler




More information about the Development mailing list