Using boost library and BOOST_FOREACH:
// http://tinyurl.com/2ujubql
#define foreach BOOST_FOREACH
#define reverse_foreach BOOST_REVERSE_FOREACH
...
void BoostTests()
{
DbgLog(__FUNCTIONW__);
boost::array<int, 3> myIntArray;
myIntArray[0] = 2;
myIntArray[1] = 8;
myIntArray[2] = 1976;
int result = 0;
foreach (int number, myIntArray)
{
result += number;
}
}
Syntax coloring if course has the effect that foreach will be displayed in other color then keywords like for, if, while etc.
In order making BOOST_FOREACH much prettier it would be nice if VA let us configure "user defined keywords" for C++.
I remember that it was possible to add user defined keywords to a list (raw text file) and VS considered that words in the list as keywords. Maybe this is still possible?