Skip to content

Wiki

Improved STL programming

About 2 min read

1.STL improves programming

This chapter organizes the core usage of STL: first acquaintance with STL, fixed arrays, strings, sequential containers, container adapters, associative containers, function objects, predicates, and common algorithms.

2.Learning Sequence

  1. std::array: Fixed-size array, suitable as a replacement for C-style fixed-length arrays.
  2. string : String container, responsible for string construction, assignment, concatenation, search, and substring extraction.
  3. vector / deque : Commonly used sequence containers, one suitable for contiguous storage at the tail, the other suitable for operations at both ends.
  4. stack / queue / list : Container adapters and linked lists, suitable for specific access patterns.
  5. set / map : Associative containers, suitable for deduplication, sorting, and key-value lookup.
  6. Function objects and predicates: using "callable logic" as algorithm parameters.
  7. Common algorithms: traversal, search, sorting, copy and replace, arithmetic generation, and set algorithms.