Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 operator method suggestions in 1618

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
jameso Posted - Nov 22 2007 : 05:56:53 AM
Given a method

T::operator gcroot<System::String^>() const

in a class, the suggestion list offers and inserts:

operator operator gcroot<System::String^>()

6   L A T E S T    R E P L I E S    (Newest First)
jameso Posted - Nov 23 2007 : 5:40:42 PM
Excellent! Thanks

James
feline Posted - Nov 23 2007 : 5:37:48 PM
That compiles

VA was giving me:
testOp.operator operator gcroot<System.String^>;

but I actually needed:
testOp.operator gcroot<System::String^>();

So just a few differences. Dot rather than double colon, and missing brackets both caused problems. These are obvious differences when you see them.

case=10093
jameso Posted - Nov 23 2007 : 4:56:29 PM

Try making operator gcroot<System::String^>() const public. I've no C++ compiler now until Monday so I can only guess what the problem is.

testOp.operator gcroot<System::String^>() should be valid I think.

James

feline Posted - Nov 23 2007 : 4:47:32 PM
Excellent example, it shows the bug perfectly I had to change it slightly, to:

using namespace System;

#include <vcclr.h>

class testClrOperator
{
	operator gcroot<System::String^>() const
	{
		return System::String::Empty;
	}
};

static void testUsingClrOperator()
{
	testClrOperator testOp;
	testOp|;
}

before it would compile. If I now type a dot VA suggests the double operator. The question is, what should VA insert?

If I disable VA and type the dot I do not get a listbox, and pressing CTRL-SPACE does not produce one either.

I have tried various things, but none of my attempts at explicitly calling this operator compile.
jameso Posted - Nov 23 2007 : 06:01:42 AM
Sorry, yes it is managed. This is a better example of what might show the problem, though I won't be able to try to reproduce until next week

James


#include <vcclr.h>

class testClrOperator
{
testClrOperator::operator gcroot<System::String^>() const
{
return System::String::Empty;
}
};

int main()
{
testClrOperator t;
t.operat[ctrl-space]
}
feline Posted - Nov 22 2007 : 11:53:49 AM
Is this C++ CLR? It looks like it, due to the ^ character.

Is this part of a template class?

using VS2005 and VA 1618 with a C++ CLR project I added the following code to a header file:

class testClrOperator
{
	T::operator gcroot<System::String^>() const;
};

but it does not compile. I know virtually nothing about C++ CLR, so I am a little out of my depth here.

Once I get the class compiling, what are you typing to see the suggestion list? Are you manually typing the implementation of this function in the cpp file?

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