Multiple ChoiceHard 45s
Class template argument deduction
Given `template<class T> struct S { S(T); };` what does CTAD allow in C++17?
Options
- 1Nothing; class templates always need explicit arguments.
- 2Only `S<> s(42);` with empty angle brackets.
- 3`S s(42);` deducing `S<int>` from the constructor argument.
- 4A compile error because the constructor is not `explicit`.
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.