Two questions concerning C++ Containers

Viewed 66
  1. Why are the Container Adapters like std::stack or std::queue implemented as adapters and not as independent containers? Is it because you want e.g. a stack with an underlying memory managment of different Sequence Containers?

  2. Why are the algorithms of the STL implemented as free functions, which expect iterators, and not as methods of the corresponding containers?

1 Answers
Related