Custom Templatized Data Structures

It’s possible to build your own custom templatized data structures, including linked lists, queues, stacks and trees. Typically these are implemented with objects that are linked together via pointers. Such code is complex and error-prone—the slightest omissions or oversights can lead to serious memory-access violations and memory-leak errors with no forewarning from the compiler. If many programmers on a large project implement custom containers and algorithms for different tasks, the code becomes difficult to modify, maintain and debug.


Image Software Engineering Observation 15.1

Avoid reinventing the wheel; program with the components of the C++ Standard Library.



Image Error-Prevention Tip 15.1

The prepackaged, templatized Standard Library containers are sufficient for most applications. Using the Standard Library helps you reduce testing and debugging time.



Image Performance Tip 15.1

The Standard Library was conceived and designed for performance and flexibility.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.77.208