vendredi 12 juillet 2019

Alias template for multiple types

I have 2 templated types:

A<int N>
B<int N>

I need these two types to be aliased by a single, third type,

C<int N, bool T>

Basically what I want is this:

template<size_t N, bool T = false>
using C = A<N>;

template<size_t N, bool T = true>
using C = B<N>;

However this throws a conflicting declaration error.

error: conflicting declaration of template 'template using C = B' using C = B;

How can I do this?

Aucun commentaire:

Enregistrer un commentaire