All challenges
Multiple ChoiceHard 45s

std::atomic_ref Requirements

What is a key requirement for using std::atomic_ref<T>?
Options
  1. 1The object must be heap-allocated so its address stays stable for the atomic_ref's lifetime
  2. 2The object must be declared volatile so accesses are not optimized away by the compiler
  3. 3T must be a pointer type, since only pointer references can be made atomic this way
  4. 4T must be trivially copyable and the referenced object must be suitably aligned

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