All challenges
Multiple ChoiceIntermediate 45s

How std::declval may be used in unevaluated context

What is std::declval<T>() used for?
Options
  1. 1To construct an object of type T with default arguments so it can be passed to a function at runtime
  2. 2To convert an existing object to type T using static_cast in an evaluated expression context
  3. 3To declare a variable of type T inside a function body without calling its constructor first
  4. 4To obtain an rvalue reference of type T in unevaluated contexts without constructing the object

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle