O'Reilly logo

Just Enough C/C++ Programming by Guy W. Lecky-Thompson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Container Classes

The STL container classes provide useful templates for developing containers for any type of element. The built-in types (classes) can be used without any need to write supporting member interfaces.

However, when user-defined types are introduced, it might be necessary to provide correct instantiation (constructors) and operators with which the compiler can substitute the default behavior. For example, if you are storing elements on an array and attempt to call a method that requires that the = = operator is overloaded, the compilation might fail if no overload is available.

In the vast majority of cases, however, the container classes themselves do not require that overloads exist because they generally work on pointers to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required