mercredi 1 août 2018

Inheriting constructor with a type alias in a template derived class

Please see the following code:

struct base {};

template <class T>
struct derived : T {
  using base_type = T;
  using base_type::T;
};

int main()
{
  derived<base> x;
}

GCC accepts this code, but Clang and MSVC reject it. Who is right and why?

Aucun commentaire:

Enregistrer un commentaire