In a function template, the type of the parameters are determined by some trait classes, so their type could get quite long like
template<typename A>
void func(typename Traits<A>::some_type_x x1, typename Traits<A>::some_type_x x2);
Is there some way to aliasing these types? My current solution is to introduce another typename in the template parameters
template<typename A, typename X = typename Traits<A>::some_type_x>
void func(X x1, X x2);
But these could potentially let the function caller to provide some invalid arguments, so I wonder if there is a more elegant solution to this problem?
std::vector<int> a, std::vector<int> bright? But at least you can still make it int.otrait_type_t<A> x1, trait_type_t<A> x2