Suppose I have four classes, A1, B1, B2, and C1. A1 is the base class, B1 and B2 inherit publicly from A1, and C1 inherits publicly from B1 and B2. B1 and B2 are virtual classes.
Now, suppose I need a member function defined in A1. Is it possible to make the member function inaccessible to B1 and B2 but accessible to C1? If the member function protected or public, then B1 and B2 still have access to it, so that doesn't work. If it's private, then C1 doesn't have access to it, so that doesn't work, so I'm kind of stuck here. I'm still quite inexperienced in C++, and I'm not sure if friend functions or friend classes make sense in this situation. If not, is this even possible?