My actual problem is a little more complicated and requires using template classes.
This is a simpler version of that.
I have two classes:
class A
{
public:
float a() { return _value; }
private:
float _value;
};
class B
{
public:
float b() { return _value; }
private:
float _value;
};
class AB : public A, public B
{
public:
// a() should return A::_value ?
// b() should return B::_value ?
}
Will there be any conflicts between the members _value from A and B if that member is private? It makes sense that there would not be such a conflict since AB has no knowledge of that member.
Even if the members were public, there would be no conflict. There would, however, be an ambiguity if you tried to access
_valuefromAB‘s scope (assumingABinherits fromAandB) without qualifying it somehow: