By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,406 Members | 888 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,406 IT Pros & Developers. It's quick & easy.

I want to know about fucntion template and STL

P: 1
I was studying about the STL. I am confused in the concept of iterator, container and algorithm in STL. Can any one of you gie me the concept on Function template and STL?
Sep 28 '06 #1
Share this Question
Share on Google+
1 Reply

P: 293
I think the basic idea behind using iterators, containers, and algorithms is to simplify things.

For example, consider printing all elements in a vector and the same task for a list. In either case, create an iterator (of type vector or list, respectively). Then, iterate through the elements of each respective container, printing the contents of each element as you go.

In fact, it is so similar, it is entirely possible to have one algorithm which iterates through any type of container, printing the contents of each element, assuming each type of contained element has a method print().
Sep 28 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.