Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

GOOSEDUMP

Abstract Template

This topic is 6254 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Guest Anonymous Poster
Yes. Dunno whether it''s ANSI/ISO C++ or not, but I did it with a couple of compilers (never tried with MSVC though, as its template support isn''t great).

Share this post


Link to post
Share on other sites
how about this then..... an abract class, thats been instantiated a couple times.....

ex
abstract (non template) class CShape with child (template) class CTriangle....

Share this post


Link to post
Share on other sites
I am not exactly sure what you''re getting at, but I''ll say this: I don''t think that, given that Derived<T> derives from Base<T>, I don''t think that Base<int>* can point to Derived<char>, for example. But I could be wrong.

Share this post


Link to post
Share on other sites
Sure, I use it:

      
template <typename TObserver>
class IObservable
{
public:
virtual HRESULT AddObserver(TObserver* pObserver)=0;
virtual HRESULT RemoveObserver(TObserver* pObserver)=0;
};

template <typename TObserver>
class CUniObservable : public IObservable<TObserver>
{
//...

}



Magmai Kai Holmlor
- Not For Rent

I even mutliply inherit from it:
  
class CGameEngine : public CObservable<IPerformanceObserver>,
public CObservable<IUIObserver>,
protected INetworkClientObserver,
protected INetworkServerObserver
{
//...

};



Edited by - Magmai Kai Holmlor on September 6, 2001 12:45:18 AM

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!