tags:

views:

178

answers:

5

What parts of STL (no boost or TR1, please) people still commonly use in their professional as well as personal environments, if any?

These days I find myself using the following:

Containers:

  • vector
  • set
  • map

Iterators:

  • const and not for above containers

Functional objects:

  • bind1st
  • bind2nd

Algorithms:

  • find
  • find_first_of
  • for_each
  • swap
  • sort

Please not only post a list of STL stuff, but also include your context or example of usage. This way we can all benefit from not just the name but its application.

A: 

I use all but binders. Boost bind is a good alternative.

I rarely use streams. Usually, I need more than the features streaming provide.

I use exceptions as base classes for my own exception types.

In the rest... I use the containers, iterators (sequences) and algorithms as needed.

Cătălin Pitiș
+2  A: 

Containers, algorithms and iterators are being used the most, at least as far as I am concerned

Ram
A: 

With remove/erase being a common idiom, I'm using std::remove a lot. I've on more than one occasion used a std::stack to make it clear to future readers what I intended (LIFO container). When I want a FIFO container, I often use std::deque.

MSalters
+1  A: 

I don't use algorithms too much because I don't like the binding and mem_fnc things too much. I can never get things done without looking up and trying a couple of times and I don't immediately understand constructs with them. I'm still waiting for C++0x lambda and bind...

stefaanv
A: 

I use std::vector when I need a collection of stuff and std::map when I need an associative array. I use iterators quite a bit, so I'm really looking forward to the auto keyword from C++0x. I don't use the standard algorithms much beyond std::for_each, but that's partly because I'm often calling the member functions find and erase for std::map.

Kristo