I've just read chapter 8 of accelerated C++, which covers template functions. From my understanding if you use a template in a function that function must be included in the header file, as opposed to a source file.

Am I correct in thinking this or am I missing something obvious?

Recommended Answers

All 2 Replies

So my understanding of the information at the link you provided me is that I either have to put the definition in the header file or add a definition for each datatype the template may be instantiated to to the source file.

Have I got the general idea?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.