Someone might find a standard quote, but I'm going to explain conceptually.
This does not work, because using-declarations only affects name lookups.
Your use-declaration makes the name lookup work successfully where it otherwise fails, that is, it tells the compiler where to find the function f . But he does not talk about it, on which the object f A acts , that is, the one that will be passed as an implicit this parameter when f called.
There is only one function A::f , although there are two subobjects A C , and it takes an implicit argument of this type of A* . To call it on object C , C* must be implicitly converted to A* . This is always ambiguous, and it is not affected by any advertisements.
(This makes sense if you put the data members inside A Then C will have two of each such data element. When f is called, if it accesses the data members, it gets access to those of them in the subobject A inherited from B1 , or those that are in subobject A inherited from B2 ?)
Brian May 04 '15 at 17:53 2015-05-04 17:53
source share