Self-test questions

For multiple choice questions, choose all the options that apply:

  1. Which of the following are true for flat associative containers compared to ordered/unordered associative containers?

    a. Require less memory

    b. Insertion is faster

    c. Traversal is slower

    d. Lookups are faster

  2. The std::forward_list does not provide a size() member function because:

    a. Linear time size members cannot be supported for singly-linked lists

    b. Both splice and size members cannot be constant time

    c. It would be thread-unsafe

    d. All of the above

  3. Where is the internal memory of a static_vector allocated:

    a. Stack

    b. Depends on where the static vector is created

    c. Free store

    d. Depends on the allocator used

  4. In order to store objects of type X in an unordered container, ...

Get Learning Boost C++ Libraries now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.