You can embed values in types. This is a method that boost has been using for a long time, if I correctly reminded it, and was added to the standard library in C ++ 11 as std::integral_constant(which indicates its usefulness).
With C ++ 17, everything has become even simpler.
template<auto val>
struct constant : std::integral_constant<decltype(val), val> {};
B2 B
template<typename T, typename N>
struct B2 { using type = B<T, N::value>; };
template<typename... Args>
struct A : public B2<Args...>::type {};
A<int, constant<42>> a;