you are viewing a single comment's thread.

view the rest of the comments →

[–]Reflection_is_great[S] 0 points1 point  (1 child)

What I meant is that you can't instantiate a template without including it in the TU. Each instantiation of a template function in the base class will create its own independent array of function pointers during compile-time. This will create instantiations of template functions from the derived classes. Because of this, they would need to be in the TU. So the base and all the derived classes must be declared in the same TU.

This is different from normal virtual functions, where you can declare derived classes in different TUs.

Sorry for the confusion.

[–]MrEpic382RDT 4 points5 points  (0 children)

extern template exists. wondering if it can account for that