On Thursday 19 February 2015 17:46:01 Giuseppe D'Angelo wrote:
> On 19 February 2015 at 17:26, Thiago Macieira <[email protected]> 
wrote:
> > Sounds like the intended behaviour to me. What's wrong with this picture?
> 
> That on a non-const shared container
> 
> for (auto i : container)
> 
> will detach it. That's why having rules instead of saying "just use
> it", I guess...

And who says it's not what you wanted?

for (auto &i : container) {
        if (i.startsWith("foo"))
                i = bar;
}

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to