A
Aleksandr Rulev
#include <iostream>
class Foo{
public:
Foo(){std::cout<<"Foo ";};
};
class Bar:Foo{
public:
Bar(){std::cout<<"Bar ";};
};
class FooToo: virtual Foo{
public:
FooToo(){std::cout<<"FooToo ";};
};
class FooTooBar: virtual FooToo,virtual Bar{
public:
FooTooBar(){std::cout<<"FooTooBar ";};
};
main (){
FooTooBar x;
}
should x be instantiated o should it give compiler error?
class Foo{
public:
Foo(){std::cout<<"Foo ";};
};
class Bar:Foo{
public:
Bar(){std::cout<<"Bar ";};
};
class FooToo: virtual Foo{
public:
FooToo(){std::cout<<"FooToo ";};
};
class FooTooBar: virtual FooToo,virtual Bar{
public:
FooTooBar(){std::cout<<"FooTooBar ";};
};
main (){
FooTooBar x;
}
should x be instantiated o should it give compiler error?