So as it turns out for the compiler I'm using (MS Visual C++), my supposition was correct that, for the code as presented in the question, the class template member instantiation would not take place at //mark1
but rather at //mark2
and Test<int>.nothing()
would not be created by the compiler.
However, it seems I left out a critical part of the issue that I was experiencing. My actual class was a part of a virtual hierarchy, and according to the MSDN help library all virtual members are instantiated at object creation. So in the example above, if both member functions, i.e. operation()
and nothing()
, are virtual then at //mark2
the compiler would try to generate code for both functions and the validation of nothing()
would fail.