It is interesting when / where implicit template creation occurs in the following situation.
// foo.h
// foo.cpp
// bar.h
// bar.cpp
// main.cpp
I think this happens when foo() is called, because this is the first use of A<int> , so A<int> implemented in foo.o
And, when bar() is called, it is bound to A<int> in foo.o
I'm right? Or does instantiation happen twice?
c ++
Hyunan kwon
source share