Book Image

Learning Boost C++ Libraries

By : Arindam Mukherjee
Book Image

Learning Boost C++ Libraries

By: Arindam Mukherjee

Overview of this book

Table of Contents (19 chapters)
Learning Boost C++ Libraries
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Self-test questions


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

  1. What is unique to the canonical and equivalent functions for manipulating paths?

    a. The arguments cannot name real paths.

    b. Both are namespace-level functions.

    c. The arguments must name real paths.

  2. What is the problem with the following code snippet assuming the path is of type boost::filesystem::path?

    if (is_regular_file(path)) { /* … */ }
    else if (is_directory(path)) { /* … */ }
    else if (is_symlink(path)) { /* … */ }

    a. It must have static value field.

    b. It must have an embedded type called type.

    c. It must have static type field.

    d. It must have an embedded type called result.

  3. Given this code snippet:

    boost::filesystem::path p1("/opt/boost/include/boost/thread.hpp");
    size_t n = std::distance(p1.begin(), p1.end());

    What is the value of n?

    a. 5, the total number of components in the path.

    b. 6, the total number of components in the path.

    c. 10, the sum of the number of slashes and components.

    d. 4, the total number of directory...