Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 foreach for C++
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

hfrmobile
Ketchup Master

Austria
79 Posts

Posted - Dec 07 2010 :  09:33:58 AM  Show Profile  Reply with Quote
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?

Visual Assist X for C/C++ and ReSharper, FxCop and StyleCop for C#, Eclipse Ganymede for Java

Edited by - hfrmobile on Dec 07 2010 09:35:14 AM

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Dec 08 2010 :  1:51:25 PM  Show Profile  Reply with Quote
I think this is what you want:

http://docs.wholetomato.com?W148

zen is the art of being at one with the two'ness
Go to Top of Page

hfrmobile
Ketchup Master

Austria
79 Posts

Posted - Dec 09 2010 :  03:33:53 AM  Show Profile  Reply with Quote
Perfect, still works under VS2008!
Developer's live can be so easy ;-)

Visual Assist X for C/C++ and ReSharper, FxCop and StyleCop for C#, Eclipse Ganymede for Java
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000