class B
{
public :
B( ) ;
virtual ~B( ) ;
} ;
class A
{
public :
using bns = B; // И вот если мы обявим его через using, то начинаются чудеса
private :
bns* m_Bclass;
public :
A( ) ;
virtual ~A( ) ;
bns* get_b( ) ;
void set_b( bns* b) ;
} ;
A:: A ( )
{
m_Bclass = nullptr;
}
A:: ~A( )
{
}
void A:: set_b ( bns* b) // тут всё нормально
{
m_Bclass = b;
}
A:: bns * A:: get_b ( ) // а тут error: ‘bns’ does not name a type
{
return m_Bclass;
}
Y2xhc3MgQgp7CnB1YmxpYzoKICAgIEIoKTsKICAgIHZpcnR1YWwgfkIoKTsKfTsKCmNsYXNzIEEKewpwdWJsaWM6CiAgICB1c2luZyBibnMgPSBCOyAvLyDQmCDQstC+0YIg0LXRgdC70Lgg0LzRiyDQvtCx0Y/QstC40Lwg0LXQs9C+INGH0LXRgNC10LcgdXNpbmcsINGC0L4g0L3QsNGH0LjQvdCw0Y7RgtGB0Y8g0YfRg9C00LXRgdCwCnByaXZhdGU6CiAgICBibnMqIG1fQmNsYXNzOwpwdWJsaWM6CiAgICBBKCk7CiAgICB2aXJ0dWFsIH5BKCk7CgogICAgYm5zKiBnZXRfYigpOwogICAgdm9pZCBzZXRfYihibnMqIGIpOwp9OwoKQTo6QSgpCnsKICAgIG1fQmNsYXNzID0gbnVsbHB0cjsKfQoKQTo6fkEoKQp7Cn0KCnZvaWQgQTo6c2V0X2IoYm5zKiBiKSAvLyDRgtGD0YIg0LLRgdGRINC90L7RgNC80LDQu9GM0L3Qvgp7CiAgICBtX0JjbGFzcyA9IGI7Cn0KCkE6OmJucyogQTo6Z2V0X2IoKSAvLyDQsCDRgtGD0YIgZXJyb3I6IOKAmGJuc+KAmSBkb2VzIG5vdCBuYW1lIGEgdHlwZQp7CiAgICByZXR1cm4gbV9CY2xhc3M7Cn0=