All challenges
Multiple ChoiceHard 45s

typename dependent qualified name

In template<class T> void f(){ typename T::value_type v{}; }, why is typename required?
Options
  1. 1Because T::value_type is a dependent qualified name that could be a type or a value
  2. 2Because value_type is a private member that cannot be named without the disambiguator
  3. 3Because T has no default constructor, so its members must be named as types explicitly
  4. 4Because typename enables SFINAE on the dependent member when substitution occurs

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