假设我们有一个依赖于两种模板类型的类,其中一种是我们专门研究构造函数,我们可以不专门研究可推导类型吗?
template <typename T, typename I>
class A {
public:
A(I i) {
}
};
int main() {
A<float, int> a(42); // this works, but we can deduce int from 42
A<float> aa(42); // doesn't work
//or
auto aaa = A<float>(42); // doesn't work
}