标签: c++ templates
我看到的代码看起来像这样:
enum Type { A, B, C }; template <Type> void foo(); void foo<A>() { // code here } void foo<B>() { // code here } void foo<C>() { // code here }
这是否比仅赋予三个函数不同的名称有什么优势呢?