You are taking quiz After 0 of 10 questions, you have 0.00 points.

Question #251 Difficulty: 2

According to the C++17 standard, what is the output of this program?

    #include <iostream>

template<class T>
void f(T) { std::cout << 1; }

void f<>(int*) { std::cout << 2; }

template<class T>
void f(T*) { std::cout << 3; }

int main() {
    int *p = nullptr; 
    f( p );


A declaration of a function template being explicitly specialized shall precede the declaration of the explicit specialization.
During overload resolution, only the base function templates are considered, not specialisations.


Mode : Quiz

If you want to quit the current quiz and go back to training mode, click here.