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
 1553: understanding template specializations
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

.oisyn
Tomato Guru

162 Posts

Posted - Apr 27 2007 :  11:08:53 AM  Show Profile  Reply with Quote
It seems that VA X is having problems understanding similar looking (partial and explicit) template specializations

template<class T> struct A;

struct B { int apple; };
struct C { int banana; };

template<> struct A<int>
{
	void func()
	{
		B var;
	}
};

template<> struct A<float>
{
	void func()
	{
		C var;
		var.  // #1
	}
};


After typing the code at #1, it comes up with a listbox containing the members of B rather than C (so it shows 'apple'). This is 100% reproducable as long as both specializations contain the same functions and the same variable name but with different types. If I rename 'var' in A<float>::func to 'var2', it does show 'banana' as expected.

Edited by - .oisyn on May 03 2007 08:08:30 AM

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Apr 27 2007 :  12:46:38 PM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the clear description.

case=6266

zen is the art of being at one with the two'ness
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