[Interest] Q_FOREACH creating copy , was (no subject)

Thiago Macieira thiago.macieira at intel.com
Tue Jun 30 19:16:47 CEST 2015


On Tuesday 30 June 2015 18:35:43 Prav wrote:
> If in definition of QForeachContainer class we add just ONE
> symbol "&" before "с" in line const T c;
> and get
>     const T &c;
> we will end up with this loop which will be same "work to write" as current
> foreach. So easy to do :) 

I've already asked you to make that modification and run some Qt applications 
to see what breaks.

> In such a way we can modify current foreach or
> add another for loop macro .. like "forevery" ... or any other name which
> is fine for majority.

Adding a new macro is overruled. Either you modify foreach to work like you 
want or we leave things as is.

> This seems to be the question to Thiago Macieira. No?
> 
> In case the idea of adding of "const ref to the container" loop will be
> rejected by community I am aware only about necessity for everybody to know
> that people may add their own for loop so that code completion feature of
> QtCreator will not use any hardcoded names like "foreach" and thus work for
> other for-loops as well.

I didn't understand this last paragraph.

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




More information about the Interest mailing list