jeudi 25 juin 2020

Using directive & scope

I have a problem with the folowing code :

struct A
{
    A(int i) {};
};

namespace Foo
{
using Alias = A;
}

struct B : Foo::Alias
{
    B();
};

B::B() : Alias(5)
{}

int main()
{
    return 0;
}

It doesn't compile because in the B constructor, I don't precise the scope of Alias.

Why ?

Thanks.

Aucun commentaire:

Enregistrer un commentaire