[Qt-interest] foreach and two template arguments
Schimkowitsch Robert
Robert.Schimkowitsch at andritz.com
Mon Aug 22 09:52:25 CEST 2011
Just out of curiosity (I have bypassed my actual problem using a
Java-style iterator), is there ANY way I could write the following const
foreach-loop:
Q_FOREACH(const CGlib_GridData<valueT, deltaT>& gridData, m_GridData)
....where I am inside a template class:
template<class valueT, class deltaT>
...where m_GridData is a member declared thus:
QList<CGlib_GridData<valueT, deltaT> > m_GridData;
-) I did not manage to create a typedef, because I do not yet have
concrete types I could set as template arguments
-) Declaring the loop variable before the Q_FOREACH is not allowed
-) The preprocessor interprets the commas in the Q_FOREACH macro, so I
get a syntax error the way it's written right now.
Kind regards
Robert Schimkowitsch
#####################################################################################
This message and any attachments are solely for the use of the intended recipients. They may contain privileged and/or confidential information or other information protected from disclosure. If you are not an intended recipient, you are hereby notified that you received this email in error and that any review, dissemination, distribution or copying of this email and any attachment is strictly prohibited. If you have received this email in error, please contact the sender and delete the message and any attachment from your system.
Thank You.
#####################################################################################
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110822/9de915cf/attachment.html
More information about the Qt-interest-old
mailing list