15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Inheriting from a CMap<> definedclass?

Mark Stevens -- MStevens@msn.com
Wednesday, December 20, 1995

Does anyone know if it is possible to create a class using a template to get  
typesafe access and then derive a class from that definition to add additional 
functionality?

something which would achieve this effect (if a typedef was a 'real' class)...

typedef CMap CMapWordToString;
class CMyStrings : CMapWordToString
{
	CMyStrings();
	DoSomethingSpecialWithMyStrings();
}

I have looked at the template definition for CMap<> but I still can't figure 
out what name it gets resolved to at compiletime?

Thanks for the help if anyone has done this.


Mark Stevens (markst@Gramercy.ios.com)



Tomasz Pawlowski -- tomasz@ix.netcom.com
Monday, January 01, 1996

Following class definition works well in my program:

class
CPlayersPicks: public CMap
{
public:
	CSize	Draw(CDC* pDC);
};

Tomasz
tomasz@ix.netcom.com

Mark Stevens wrote:
> 
> Does anyone know if it is possible to create a class using a template to get
> typesafe access and then derive a class from that definition to add additional
> functionality?
> 
> something which would achieve this effect (if a typedef was a 'real' class)...
> 
> typedef CMap CMapWordToString;
> class CMyStrings : CMapWordToString
> {
>         CMyStrings();
>         DoSomethingSpecialWithMyStrings();
> }
> 
> I have looked at the template definition for CMap<> but I still can't figure
> out what name it gets resolved to at compiletime?
> 
> Thanks for the help if anyone has done this.
> 
> Mark Stevens (markst@Gramercy.ios.com)




| Вернуться в корень Архива |