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
 friend and forward declarations
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

leto58
Junior Member

17 Posts

Posted - Oct 07 2008 :  04:32:13 AM  Show Profile  Reply with Quote
Hi,

If I write
class B
{
	friend class A;
};

VA handles A properly.

If I write
class A;

class B
{
	friend A;
};

which is legal C++ too, as far as I know, A is handled as an unknown variable rather than as a class, by VA.

Regards,
Leto



VA_X.dll file version 10.4.1649.0 built 2008.09.09
Licensed to:xxx
DevEnv.exe version 8.0.50727.867
msenv.dll version 8.0.50727.867
Font: Courier 13(Pixels)
Comctl32.dll version 6.10.6001.18000
Windows Vista 6.0 Build 6001 Service Pack 1
4 processors

Platform: Win32
Stable Includes:
D:\\Program Files\\Microsoft Visual Studio 8\\VC\\include;
D:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\include;
D:\\Program Files\\Microsoft Visual Studio 8\\VC\\PlatformSDK\\include;
D:\\Program Files\\Microsoft Visual Studio 8\\SDK\\v2.0\\include;

Other Includes:

Stable Source Directories:
D:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\mfc;
D:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\mfcm;
D:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\atl;
D:\\Program Files\\Microsoft Visual Studio 8\\VC\\crt\\src;

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Oct 07 2008 :  4:00:45 PM  Show Profile  Reply with Quote
Why do you think that A is handled as an unknown variable?
It is underlined with red for you, or do you see/experience something else?
Go to Top of Page

leto58
Junior Member

17 Posts

Posted - Oct 07 2008 :  5:23:53 PM  Show Profile  Reply with Quote
Hi,
Excuse me for my too short explanation. Here is a more complete example:
(Note: class A is defined in another file in my project)

if I write
class B
{
	friend class A;
	A* MyFunction();
};

A is highlighted with color defined for "class, structures and typedefs" and if I click the VA arrow above MyFunction, I get (among others) "create Implementation".


if I write

class A;

class B
{
	friend A;
	A* MyFunction();
};

A is highlighted with color defined for "Variables" and if I click the VA arrow above MyFunction, I DO NOT get "create Implementation".

Regards,
Leto
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Oct 08 2008 :  03:51:35 AM  Show Profile  Reply with Quote
I am seeing the same thing here, thank you for the clear description:

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