Qt foreach is giving me sytax error highlight in Eclipse.
I'm programming in C++ using a Qt framework.
I use Eclipse SDK (3.5.2) as my text editor / IDE.
I compile in a console outside of Eclipse using GCC.
When I'm editing my files in Eclipse, I find that Qt's "foreach" is highlighting as a syntax error.
Does anyone know how to fix this? It's not majorly important or anything but it's starting to annoy me. It's as though it's not recognizing the command or something...
If you've enable c++11 support in Eclipse you can redefine 'foreach' to be a range based for loop. In the project properties, select 'Paths and Symbols' in the left pane, then select the 'Symbols' tab. Add a new symbol with 'Name'= foreach(a,b) 'Value'=for(a:b) Select 'Add to all configurations' and 'Add to all languages'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With