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
About the Author
About the Reviewers

Self-test questions

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

  1. What are the advantages of using boost::swap over std::swap?

    a. There is no real advantage

    b. boost::swap invokes swap overloads supplied with the passed type, if any

    c. boost::swap is faster than std::swap

    d. boost::swap does not throw exceptions

  2. Can you apply a visitor to multiple variant arguments in a single call? (Hint: you may want to look up the online documentation)

    a. Yes. A visitor can only be applied to one or two variant arguments

    b. Yes. A visitor can be applied to one or more arguments

    c. No. The member operators take only one variant argument

    d. None of the above

  3. Is the following a valid compile-time assert?

    BOOST_STATIC_ASSERT(x == 0); // x is some variable

    a. Yes, provided x is of an integral type

    b. Yes, provided x is declared as a const static numeric variable

    c. No, x is a variable, and its value cannot be known at compile time

    d. Only expressions involving sizeof are valid in a BOOST_STATIC_ASSERT...