"At some point you have to stop introducing features and focus on the details. Otherwise, you never finish the work."
- Nicolai Josuttis
Key points throughout these sections:
- The C++ standard template library containers were designed with value semantics in mind. It is also not possible to store auto_ptrs in the containers due to the effect of the assignment operator. For reference semantics, the Boost pointer array should come in handy.
- The STL was also designed for performance rather than safety. There are some containers that throw exceptions, but not many. The burden of safety falls on the code that uses the STL.
- There are sequential containers and associative containers. Which container to use depends on the behavior of the software because containers behavior differently.
- Associative containers are represented internally by binary (Red-Black) trees.
- Container traversal must be done through iterators. Iterators have their own hierarchy of traits: input, output, forward, bidirectional, and random access. Understanding this hierarchy helps to understand which containers allow which types of iterators.
- All container algorithms take iterators as arguments, not the containers themselves.
- auto_ptr is a smart pointer that uses remove-on-copy during assignment, so assigning one auto_ptr to another will cause the pointer of the original to become invalid.
- typename versus class, but is important to cover here due to the templates used throughout the examples.
The remaining sections of this book cover algorithms, strings, additional containers, input/output streaming, and internationalization.
- Nicolai Josuttis
Key points throughout these sections:
- The C++ standard template library containers were designed with value semantics in mind. It is also not possible to store auto_ptrs in the containers due to the effect of the assignment operator. For reference semantics, the Boost pointer array should come in handy.
- The STL was also designed for performance rather than safety. There are some containers that throw exceptions, but not many. The burden of safety falls on the code that uses the STL.
- There are sequential containers and associative containers. Which container to use depends on the behavior of the software because containers behavior differently.
- Associative containers are represented internally by binary (Red-Black) trees.
- Container traversal must be done through iterators. Iterators have their own hierarchy of traits: input, output, forward, bidirectional, and random access. Understanding this hierarchy helps to understand which containers allow which types of iterators.
- All container algorithms take iterators as arguments, not the containers themselves.
- auto_ptr is a smart pointer that uses remove-on-copy during assignment, so assigning one auto_ptr to another will cause the pointer of the original to become invalid.
- typename versus class, but is important to cover here due to the templates used throughout the examples.
The remaining sections of this book cover algorithms, strings, additional containers, input/output streaming, and internationalization.
Comments
Post a Comment