The code below will not compile, because when I want to specify Param
, type deduction of A
and B
is disabled and I would have to specify those explicitly as well.
#include <iostream>
template<typename A, typename B>
struct L
{
};
template<typename A, typename B, unsigned Param = 0>
void fn(L<A, B> l_) {}
int main()
{
L<int, float> l;
fn<3>(l);
}
Is it possible to have the best of both worlds with deduction of A
and B
and yet still be able to provide Param
, which has a default value in case it is left out?