Self-test questions
For multiple-choice questions, choose all options that apply:
- What is unique to the
canonical
andequivalent
functions for manipulating paths?a. The arguments cannot name real paths.
b. Both are namespace-level functions.
c. The arguments must name real paths.
- 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
. - 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...