Its been quite some time (16+ months) I’ve been out of college and started using STL. Trust me, I didn’t know much about STL in college, though I used std::string & std::vector everywhere I could. Now, it seems like I couldn’t (wouldn’t ?) write a program without using STL at all. A few snippets that I really found useful (and simple) and I regularly use where ever possible.
To output the elements (all / subset) in a container (lets say vector), separated by a delimiter, say new line:
Want to sort an array? No problem … :)
Read from the standard input into a vector until the end-of-stream?
1 2 3 4 5 6 7 8 9 10
Count the no. of instances an object is found?
And let me inform you… This is just a grain of what STL can do…. :)