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
 Type-resolution with Implement Method
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

andre.horst
Tomato Guru

Germany
150 Posts

Posted - May 02 2012 :  04:27:47 AM  Show Profile  Reply with Quote
Latest VAX, Win7, VS2008, C++.

VAX has problems to resolve the right type in template inheritance for the "Implement Virtual Methods..." function. See following example.

template< typename T >
struct s
{
	typedef T t_Type ;
} ;

template< typename T >
class CBase : public T
{
public:
	virtual typename T::t_Type f( void ) = 0 ;
} ;

class CImpl
: public CBase< s< int > >
{
public:
// VAX "implements" the following ("typename T::" should be removed)
// 	virtual typename T::t_Type f( void ) 
// 	{
// 		throw std::exception("The method or operation is not implemented.");
// 	}
	t_Type f( void ){ return 1 ;}
} ;


Also note, that CImpl may also be a template class and in some cirumstances the typename and qualifier is required.

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - May 02 2012 :  7:28:20 PM  Show Profile  Reply with Quote
Implement Interface is not being offered on the child class, "CImpl" here, which is a known problem:

case=56625

The return type, given that the child class is not a template class, is covered by:

case=55701

which is expecting the type "t_Type" to be expanded to "int" here, since the template type is now defined / known.

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

andre.horst
Tomato Guru

Germany
150 Posts

Posted - May 03 2012 :  01:43:12 AM  Show Profile  Reply with Quote
I don't see a reason to resolve the type to int. The type is still a typedef in the base class. Only the "typename" and the qualifier has to be removed.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - May 04 2012 :  6:18:21 PM  Show Profile  Reply with Quote
*ah* I see now, I did not read your sample code closely enough. My mistake

I have put in a bug report for handing the typedef type correctly here:

case=66543

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