Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Move implementation to source for friend 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
__Daniel__ Posted - Jan 17 2012 : 08:00:41 AM
Hello.

Latest version of VA.


class CTest
{
public:
	friend CTest operator*( const CTest& crLeft, const CTest& crRight )
	{
		return crLeft * crRight;
	}
};


Use "move implementation..."
cpp:

friend CTest std::operator*( const CTest& crLeft, const CTest& crRight )
{
	return crLeft * crRight;
}


"friend" and "std"?

EDIT:
When CTest is in namespace in cpp it appears outside namespace
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jan 18 2012 : 1:34:05 PM
Thank you for the clear description, I am seeing the same problem here, and it does seem to be a friend function specific bug:

case=64095

Are you aware that you can use VA Outline to help you move the friend function implementation into the namespace, after it has been created?

http://www.wholetomato.com/products/features/vaoutline.asp

Hopefully this will help a bit.
__Daniel__ Posted - Jan 18 2012 : 01:50:11 AM
quote:

For the namespace problem, how is the cpp file set? Are you using a "using namespace" line? Do you have the namespace inside the cpp file?



cpp with namespace:

namespace Test1
{

}

friend CTest std::operator*( const CTest& crLeft, const CTest& crRight )
{
	return crLeft * crRight;
}

feline Posted - Jan 17 2012 : 3:08:23 PM
I am seeing the same effect here. Thank you for the clear description. The problem with "friend" and "std::" is:

case=2962

For the namespace problem, how is the cpp file set? Are you using a "using namespace" line? Do you have the namespace inside the cpp file?

Using a very simple test, and avoiding friend functions to try and pin down just the namespace effect, I have added the following code to a C++ header file:

namespace testMoveImpSpace
{
	class CTestMove
	{
		int moveMemberFunc() { return 1; }
	};
}

and when I trigger Move Implementation to Source File on this member function the namespace is correctly added before the class name on the implementation in the cpp file.

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