[Interest] Q_FOREACH creating copy , was (no subject)
Thiago Macieira
thiago.macieira at intel.com
Tue Jun 30 22:21:36 CEST 2015
On Tuesday 30 June 2015 22:55:45 Prav wrote:
> > I've already asked you to make that modification and run some Qt
> > applications to see what breaks.
>
> OK ... I will do. Any ideas what app can be a good test?
Qt Creator, for starters. Try some of the other examples too. It would be a
good idea to run the applications that use foreach in their code.
> >> 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.
>
> I mean that I suggest to have "const ref to container" loop for goodness of
> all. If this will be rejected by responsible persons ... it does not hurt
> me. I would have problems if developers of QtCreator will design code
> completion feature so that it will use some special knowledge about what is
> foreach and as the result code completion would work for foreach and will
> not work for "forevery".
Qt Creator does handle foreach, forever, emit, signals, slots (and their Q_ +
uppercase versions) specially, indeed. It treats them as keywords, as opposed
to macros. But other than that, I don't see why your own macro wouldn't work
in Creator.
> So at least I wish that someone will tell loudly in meeting (I do now know
> when this happens but I guess people must coordinate their work somehow)
> that even if we decided to not change anything with qt's foreach loops
> others are using their own modification of foreach and code completion
> should work for others for-loops too.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Interest
mailing list