Sign in to follow this  
giugio

c++ templates

Recommended Posts

giugio    246
ciao. I'm still suding the templates but i'm not understand also where is better to use they instead of the common classes. What are the features in that you advice me to use templates? Have you a link or two word for clarify my ideas? thanks.

Share this post


Link to post
Share on other sites
stonemetal    288
Look at how the standard library uses them. Templates are good when you need to express a generic idea where a common base class would be to intrusive. Consider the case of std::vector. How would you implement this with out templates? You would more or less end up writing an implementation for each type that needed a vector. You would probably write a bunch of helper functions that worked on void* and sizeof.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this