我在http://en.cppreference.com/w/cpp/language/partial_specialization上找到了这个例子
template <int I, int J, int K> struct B {};
template <int I> struct B<I, I*2, 2> {}; // OK: first parameter is deducible
Run Code Online (Sandbox Code Playgroud)
使用-std = c ++ 11和-std = c ++ 14编译时出错
怎么编译呢?或者可能是错误的例子?
error: template argument ‘(I * 2)’ involves template parameter(s)
template <int I> struct B<I, I*2, 2> {}; // OK: first parameter is deducible
Run Code Online (Sandbox Code Playgroud)