Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • You can fix it by changing the definition of D to class D : virtual public A, private C, private B but you are playing with fire if reordering things changes the output. Here is a sample with that change: onlinegdb.com/XOMzDDI8f Commented Jan 20, 2021 at 20:40
  • @JerryJeremiah It's my mistake, I wrote { _a = a, _b = 5; } instead of { _a = a, _b = 5; }, what I want to do is to copy member B::_a to D::_a and C::_b to D::_b Commented Jan 20, 2021 at 20:44