Template deduction with some user-supplied arguments

284 views Asked by At

Suppose there is a class with two template parameters

template<typename A, typename B>
class C {
  C(B::X x) {}
};

is it possible to have a deduction guide where only one of the parameters is inferred and the other is user-specified?

template<typename A, typename D>
C(D) -> C<A, D::Y>;

When I try this, clang gives me "deduction guide template contains a template parameter that cannot be deduced"

0

There are 0 answers