我正努力做这项工作:
template < typename T, T VALUE >
void f()
{
/* ... */
}
int main()
{
f<10>(); // implicit deduction of [ T = int ] ??
return (0);
}
Run Code Online (Sandbox Code Playgroud)
目的是简化更复杂的模板.
经过多次搜索,我在C++ 0x上找不到任何方法,所以stackoverflow是我最后的选择.