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
 difficulty resolving parentheses + . operator
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

diehard2
Junior Member

19 Posts

Posted - Jan 26 2011 :  12:09:16 PM  Show Profile  Reply with Quote
Hello, the following snippet does not resolve correctly in VAX on the Subtract call in _tmain
#include "stdafx.h"

class MyInterval
{
public:
	MyInterval(int x, int y)
	{	}

	int Subtract()
	{
		return 0;
	}
};

class MyThing
{
public:
	MyThing(int x):m_x(x)
	{}

	MyInterval operator- (const MyThing& x) const
	{
		return MyInterval(this->m_x, x.m_x);
	}
private:
	int m_x;
};

int _tmain(int argc, _TCHAR* argv[])
{
	MyThing thing1(5);
	MyThing thing2(6);

	int x = (thing2 - thing1).Subtract();
}



Typing (thing2 - thing1). brings up the members for class MyThing instead of MyInterval. The line

(thing2 - thing1).Subtract();

has subtract underlined in red. I'm using Visual Studio 2008 SP1 and VAX build 1840

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jan 27 2011 :  4:48:17 PM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the code sample.

case=38782
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