hpp/cpp

来源:互联网 发布:广州市知用中学分数线 编辑:程序博客网 时间:2024/04/28 01:45

"template function" or "template class"  must be written in .h file or .hpp file

It's a more common way to write Template-Function's implement in .hpp file.


Or , if you write template-function in cpp, you will get the error " symbol not defined"


Reason:Complier won't complie template (Just leave a "placeholder"), it is complied when it has been used.

But it won't compile twice or more if meets  the same template-type.

0 0
原创粉丝点击