All challenges
Multiple ChoiceIntermediate 45s

Why the Meyers singleton is thread-safe

The Meyers singleton uses a function-local static. Why is it thread-safe in C++11 and later?
Options
  1. 1Because static locals are always initialized at program start
  2. 2Because the singleton's constructor is noexcept
  3. 3Because a mutex is implicitly added by the compiler in all cases
  4. 4The standard guarantees thread-safe initialization of function-local statics

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