...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
#include <boost/phoenix/stl/container.hpp>
The container module predefines a set of lazy functions that work on STL containers. These functions provide a mechanism for the lazy evaluation of the public member functions of the STL containers. The lazy functions are thin wrappers that simply forward to their respective counterparts in the STL library.
Lazy functions are provided for all of the member functions of the following containers:
Indeed, should your class have member functions with the same names and signatures as those listed below, then it will automatically be supported. To summarize, lazy functions are provided for member functions:
The lazy functions' names are the same as the corresponding member function. The difference is that the lazy functions are free functions and therefore does not use the member "dot" syntax.
Table 1.4. Sample usage
"Normal" version |
"Lazy" version |
---|---|
|
|
|
|
|
|
Notice that member functions with names that clash with stl algorithms are absent. This will be provided in Phoenix's algorithm module.
No support is provided here for lazy versions of operator+=
, operator[]
etc. Such operators are not specific
to STL containers and lazy versions can therefore be found in operators.
The following table describes the container functions and their semantics.
Arguments in brackets denote optional parameters.
Table 1.5. Lazy STL Container Functions
Function |
Semantics |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|