Jump to content

Templated member function into .cpp file

Recommended Posts

Simple answer: No. A template is a pattern, which the compiler uses to generate a concrete implementation of a class/function once you use it (i.e., at the place where you either specify the template arguments explicitly or the compiler determines them based on the arguments passed to a function call of a templatized function. Therefore, the compiler has to see at all times the definition of a templated class/function.

More information can be, e.g., found in this FAQ: https://isocpp.org/wiki/faq/templates#templates-defn-vs-decl


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now