#include <stdio.h>

template <class T>
void f(T)                               /* A: the general template */
{
    printf("A: f(T)\n");
}

/* changing order of S and B results in different behaviour */

template <>
void f(int*)                            /* S: special case for int* */
{
    printf("S: special case\n");
}

template <class T>
void f(T*)                              /* B: an overload for pointers */
{
    printf("B: f(T*)\n");
}

int main()
{
    int n = 0;
    f<int>(&n);
    return 0;
}
