Hi, I don't understand what you don't want to happen for the B class. do you want to hide the functionaly from a b object or the declaration; like this:
int main()
{
A a;
B b;
a.fun(); // outputs "a"
b.fun(); // compiles but doens't do something
// or
b.fun(); // doens't compile
A* p = &b;
p->fun(); // compiles but doens't do something
b.A::fun(); // compiles but doens't do something
}
Maybe you could use the Facade pattern to hide the unwanted A functionaly.
Learn from the mistakes of others, you may not live long enough to make them all yourself.