How Many Copies

How many versions of this function exist in the final binary?

template<typename T>
T add(T a, T b) { return a + b; }

int main() {
    add(1, 2);
    add(1.0, 2.0);
    add(1, 3);
}
A

0: templates are interpreted at runtime, not compiled into the binary

B

1: the compiler generates a single generic version

C

2: one for int and one for double; the two int calls share the same instantiation

D

3: one per call site regardless of types