Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Type-resolution with Implement Method

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
andre.horst Posted - May 02 2012 : 04:27:47 AM
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.
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - May 04 2012 : 6:18:21 PM
*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
andre.horst Posted - May 03 2012 : 01:43:12 AM
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.
feline Posted - May 02 2012 : 7:28:20 PM
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.

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