Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 foreach for C++

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
hfrmobile Posted - Dec 07 2010 : 09:33:58 AM
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?
2   L A T E S T    R E P L I E S    (Newest First)
hfrmobile Posted - Dec 09 2010 : 03:33:53 AM
Perfect, still works under VS2008!
Developer's live can be so easy ;-)
feline Posted - Dec 08 2010 : 1:51:25 PM
I think this is what you want:

http://docs.wholetomato.com?W148

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000