Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 5. Sequences and Iterators > Intrinsic Sequence Operations

5.7. Intrinsic Sequence Operations

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.

Table 5.10. Intrinsic Sequence Operations
ExpressionResultWorst-Case Complexity
mpl::empty<S>::typeA 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>::typeAn integral constant wrapper whose ::value is the number of elements in S.Linear in the length of S.



  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial