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
 Technical Support
 Intellesense Problem w/Boost
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

photo_tom
New Member

2 Posts

Posted - Apr 15 2010 :  2:08:04 PM  Show Profile  Reply with Quote
I'm using VA 10.5.1738.0 on VS2008sp1.

I'm having a problem with intellesnse getting confused when I use the following code at the header of my c++ member function -

	QDataStream* ds = NULL;
	QDataStream* dsNew = NULL;
	BOOST_SCOPE_EXIT((ds)(dsNew))
		{
		delete ds;
		delete dsNew;
		}BOOST_SCOPE_EXIT_END ;


If I comment out the boost section, intellesense starts working again w/o any problems. Suggestions?

gmit
Whole Tomato Software

Croatia
90 Posts

Posted - Apr 15 2010 :  2:32:48 PM  Show Profile  Reply with Quote
May I ask why don't you use auto_ptr instead? Code will be more readable, it will compile faster and VA won't be confused by Boost preprocessor library.
Go to Top of Page

photo_tom
New Member

2 Posts

Posted - Apr 15 2010 :  3:08:03 PM  Show Profile  Reply with Quote
quote:
Originally posted by gmit

May I ask why don't you use auto_ptr instead? Code will be more readable, it will compile faster and VA won't be confused by Boost preprocessor library.




Because the BOOST_SCOPE_EXIT works differently. The purpose of this macro is not to create a pointer, but rather to ensure under all possible (including exceptions) reasons, when the routine exits, the two pointers will be deleted. I've forwarded the syntax for the simplest case to this forum. In reality, I have some more complex cases where I need the functionality that this gives me.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18951 Posts

Posted - Apr 23 2010 :  3:55:15 PM  Show Profile  Reply with Quote
Can you explain what problems you are seeing? Using VA 1822 I have added the following code to a C++ header file:

class testBoostScopeExit
{
	QDataStream* ds = NULL;
	QDataStream* dsNew = NULL;
	BOOST_SCOPE_EXIT((ds)(dsNew))
	{
		delete ds;
		delete dsNew;
	}BOOST_SCOPE_EXIT_END ;
	QDataStream* dsAfter = NULL;
};

static void testUsingBoostScopeClass()
{
	testBoostScopeExit fooBoost;
	fooBoost.|
}


When I type the dot, I get a listbox showing me 4 members of this class. "BOOST_SCOPE_EXIT" is also listed, along with the three member variables, which is not ideal, but so far I am not seeing any significant problems.

zen is the art of being at one with the two'ness
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