-
January 1st, 2018, 10:49 AM
#1
[RESOLVED] Why we cannot put class template member function definition in cpp file.
If I class template member function definition in cpp file,I got bunch of linker error.But it works fine if the definition is in the header file along with the class template.Why is it like that?.Did I miss something.
-
January 1st, 2018, 11:20 AM
#2
Re: Why we cannot put class template member function definition in cpp file.
Originally Posted by noobofcpp
Why is it like that?.Did I miss something
By putting the whole template definition in an include file you are using the inclusion model. See here for an explanation,
https://docs.microsoft.com/en-us/cpp...-cpp-templates
Last edited by wolle; January 1st, 2018 at 11:27 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|