语法糖越甜,编译调试查错越苦!
如果已经知道哪些需要特化的话,我自己的代码里经常是声明写.h,定义写.inl,然后对于每个特化写一个cpp,#include .h, #include .inl, 然后template class A<int>;。调用者只#include .h。 inl重写只会影响到每个特化的cpp,不会影响到调用者。
64,644
社区成员
250,475
社区内容
加载中
试试用AI创作助手写篇文章吧