Skip to content
KALANBLON
Show contents

Chapter 3 of 7 · 10 min

Quiz: resources and generic code

Move semantics, the rule of zero, templates and concepts: let's check that you write C++ that's both safe and efficient. You need 70 % correct answers, and every answer is explained.

Quiz

5 questions · pass mark: 70%

  1. 1.What does std::move(a) do on its own?

    One answer

  2. 2.What does the rule of zero say?

    One answer

  3. 3.Why mark a move constructor noexcept? (several answers)

    Several answers possible

  4. 4.Complete the standard concept that only accepts integer types.

    Complete the code

    template <std::________ T>
    T gcd(T a, T b);
  5. 5.What is the main benefit of a template constrained by a concept?

    One answer

Your progress is saved on this device. Create a free account to keep your progress on all your devices.