Including .cpp file in the header file for a template class

后端 未结 1 1065
囚心锁ツ
囚心锁ツ 2021-01-19 00:24

I do know that template class\'s definition and implementation should be on the same header file. But I was taught a bit differently at school.

I\'ll have the templa

1条回答
  •  走了就别回头了
    2021-01-19 01:03

    "Is this bad programming practice?"

    In general not and it's a very common technique. But the problem is the .cpp file extension, that would affect many IDEs and build systems to consider it as a regular source file. More commonly used extensions are .tcc, .tpc.

    0 讨论(0)
提交回复
热议问题