Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 difficulty resolving parentheses + . operator

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
diehard2 Posted - Jan 26 2011 : 12:09:16 PM
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

1   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Jan 27 2011 : 4:48:17 PM
I am seeing the same effect here. Thank you for the code sample.

case=38782

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