I am trying to understand why there is a "template parameters not deducible in partial specialization". I could not find an answer to this with current answers.
Pre:
template<std::size_t, class T, class F>
struct IF {
using type = T;
};
template<class T, class F>
struct IF<0, T, F>
{
using type = F;
};
Actual Issue:
template <std::size_t x, std::size_t y, std::size_t z = x*y >
struct Selector
{
using A = int; //simplified for questioning- uses x,y
using B = float;
using type = typename IF<z, A, B>::type;
};
template <std::size_t x, std::size_t y>
using MyType = typename Selector<x, y>::type;
//Everything is good until here.
template <typename T>
struct XTyp;
// struct XTyp : std::integral_constant<std::size_t, 0> {};
template <std::size_t x, std::size_t y>
struct XTyp<MyType<x, y> > : std::integral_constant<std::size_t, x>
{
};
error: template parameters not deducible in partial specialization: struct XTyp<MyType<x, y> > : std::integral_constant<std::size_t, x> note: ‘x’ note: ‘y’