Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1812: -> not working with template example

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
Luke1410 Posted - Feb 17 2010 : 10:43:44 AM
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.
4   L A T E S T    R E P L I E S    (Newest First)
Luke1410 Posted - Feb 23 2010 : 06:57:22 AM
thx for the workaround --- that one really worked quite fine for us
feline Posted - Feb 18 2010 : 4:53:17 PM
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.
Luke1410 Posted - Feb 18 2010 : 4:47:23 PM
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
accord Posted - Feb 18 2010 : 3:44:12 PM
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

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