Fri*_*igg 6 c++ templates typedef specialization
我有这样的事情:
typedef int AnotherType;
template <typename T> Func( T Value );
// And I want to specialize these two cases separately:
template <> bool Func<int>( int Value ) {...}
template <> bool Func<AnotherType>( AnotherType Value ) {...}
Run Code Online (Sandbox Code Playgroud)
我真的不需要专门用于int,我真正需要的是为AnotherType执行不同的函数.我无法更改AnotherType或基本函数的定义.
由于SFINAE,重载也无济于事.
| 归档时间: |
|
| 查看次数: |
663 次 |
| 最近记录: |