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
 operator method suggestions in 1618
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jameso
Ketchup Master

United Kingdom
83 Posts

Posted - Nov 22 2007 :  05:56:53 AM  Show Profile  Reply with Quote
Given a method

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

in a class, the suggestion list offers and inserts:

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

feline
Whole Tomato Software

United Kingdom
18946 Posts

Posted - Nov 22 2007 :  11:53:49 AM  Show Profile  Reply with Quote
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?

zen is the art of being at one with the two'ness
Go to Top of Page

jameso
Ketchup Master

United Kingdom
83 Posts

Posted - Nov 23 2007 :  06:01:42 AM  Show Profile  Reply with Quote
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]
}
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18946 Posts

Posted - Nov 23 2007 :  4:47:32 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

jameso
Ketchup Master

United Kingdom
83 Posts

Posted - Nov 23 2007 :  4:56:29 PM  Show Profile  Reply with Quote

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

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18946 Posts

Posted - Nov 23 2007 :  5:37:48 PM  Show Profile  Reply with Quote
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

zen is the art of being at one with the two'ness
Go to Top of Page

jameso
Ketchup Master

United Kingdom
83 Posts

Posted - Nov 23 2007 :  5:40:42 PM  Show Profile  Reply with Quote
Excellent! Thanks

James
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