Jump to content
  • Advertisement
Sign in to follow this  
giugio

templates and c++

This topic is 2129 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

hello.
I'm studing the c++ templates.
I have two question:
1)exist some template patterns like the book of the gof but for template programming? how i can find a book if there are?
2)the interfaces and abstract classes are not useful if i use template?
you Have a book to advices on the template programming?
thanks.

Share this post


Link to post
Share on other sites
Advertisement
In addition to jwezorek's suggestion.

Abstract classes are still useful in conjunction with templates. I quite often find myself using a pattern where there's a non-template base class with pure virtual functions, and derived from that is a template class such that each template instantiation implements the interface for a different concrete type. Quite often some form of type erasure is going on when this pattern is used.

This is how things like boost::any, std::function, the deleter functor in shared_ptr<>, etc are implemented.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!