0

I have two QStringList instances over which I want to iterate at the same time. Using a for loop and two iterators it would work.

But as I do it pretty often and whould like to reduce typing, is there a possibility to do it with Qt's foreach macro (I'm using Qt 4.8) or probably even a special macro for this?

Valentin H
  • 7,240
  • 12
  • 61
  • 111
  • have a look at http://stackoverflow.com/questions/12552277/whats-the-best-way-to-iterate-over-two-or-more-containers-simultaneously and http://stackoverflow.com/questions/7286755/how-can-i-iterate-over-two-vectors-simultaneously-using-boost-foreach – m.s. Oct 28 '15 at 15:24
  • @m.s. These are not about Qt's foreach. I don't use boost and unfortunatelly don't have C++11 in this project. – Valentin H Oct 28 '15 at 15:46
  • @ValentinHeinitz i don't think it's possible, since qt's foreach is simple a macro defined within qt and it could only support item and container separated by ",", all other would produce error – Shf Oct 28 '15 at 16:11

0 Answers0