I try to create template alias which cannot be distinguished from original.
So, I create traits to check when 2 templates (not types) are equal:
template <template <class...> class C1,
template <class...> class C2>
struct is_same_template : std::false_type {};
template <template <class...> class C1>
struct is_same_template<C1, C1> : std::true_type {};
Now test it:
// Expected alias
template <typename ... Ts> using V_Ts = std::vector<Ts...>; // Variadic
// Fallback alias
template <typename T, typename A> using V = std::vector<T, A>; // Exact count
static_assert(!is_same_template<std::vector, V_Ts>::value); // Alias rejected by gcc/clang
static_assert( is_same_template<std::vector, V>::value); // Alias accepted only for gcc
Is it possible to create "true" alias? which compiler is right?
static_assert(!is_same_template<std::vector, V_Ts>::value);
is accepted by both gcc 8.3 and clang 8.0.0. Is there some other issue with that line that I'm not seeing? – Kinship