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
 1812: -> not working with template example
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Luke1410
Senior Member

32 Posts

Posted - Feb 17 2010 :  10:43:44 AM  Show Profile  Reply with Quote
using the following code exmaple:


template <typename T> class Base
{
};

template<class T> class Second : public Base<Second<T> >
{
private:
	T* PointTo;

public:	
	Second();

	T* operator->() const
	{
		return PointTo;
	}
};

class Foo
{
public:
	void test() const {}
};

void main()
{
	Second<Foo> pfoo;
	pfoo->
}


When entering pfoo-> in main(), I don't see a suggestion list unless I set VAX to also take the intellisense suggestions into account, too. However, after entering "pfoo->test();" test is correctly color-coded as being a valid method.

This is really giving us a hard time atm, since most of our devs have intellisense disabled and rely on VAX and we just recently replaced almost all of our pointers with smart pointers.

Edited by - Luke1410 on Feb 17 2010 10:45:02 AM

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Feb 18 2010 :  3:44:12 PM  Show Profile  Reply with Quote
Turning on

VA Options -> Advanced -> Listboxes -> Get content from default Intellisense

will not help if you have disabled default intellisense. I didn't and it is working for me using VS2008 SP1 and this setting. What IDE do you use?

Anyway, I am seeing the same effect here. Thank you for the clear description. This is

case=39159
Go to Top of Page

Luke1410
Senior Member

32 Posts

Posted - Feb 18 2010 :  4:47:23 PM  Show Profile  Reply with Quote
I guess there's a misunderstanding here. :)
The listbox contains the proper suggestion if "Get content from default Intellisense" is enabled. That's working fine. All I wanted to state is that this is not an option for all of our developers, since some of them have disabled intellisense.

Just to answer ur question anyway: we'r using VS 2005 SP1
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18950 Posts

Posted - Feb 18 2010 :  4:53:17 PM  Show Profile  Reply with Quote
I think I have a workaround solution for this problem, but it is not very nice. Changing your code, so the derived template class looks like this:

#ifdef VA_HELPER_CODE
class dummy_base_class { };
#define BASE_CLASS_FOR_SECOND public dummy_base_class
#else
#define BASE_CLASS_FOR_SECOND public Base<Second<T> >
#endif

template<class T> class Second : BASE_CLASS_FOR_SECOND
{
    // ...
}

fixes the problem for me. It seems having a template class as the base class is causing problems.

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

Luke1410
Senior Member

32 Posts

Posted - Feb 23 2010 :  06:57:22 AM  Show Profile  Reply with Quote
thx for the workaround --- that one really worked quite fine for us
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