Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
MPL supplies a catalog of sequence metafunctions whose STL counterparts are usually implemented as member functions. We’ve already discussed begin, end, front, back, push_front, push_back, pop_front, pop_back, insert, erase, and clear; the rest are summarized in Table 5.10, where R is any sequence.
| Expression | Result | Worst-Case Complexity |
|---|---|---|
| mpl::empty<S>::type | A bool constant wrapper; true iff the sequence is empty. | Constant. |
| mpl::insert_range< S, pos, R >::type | Identical to S but with the elements of R inserted at pos. | Linear in the length of the result. |
| mpl::size<S>::type | An integral constant wrapper whose ::value is the number of elements in S. | Linear in the length of S. |