SHARE
TWEET

Untitled

a guest Feb 20th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. struct V {
  4.   int x = 9;
  5. };
  6.  
  7. struct W{
  8.   int y = 8;
  9. };
  10.  
  11. struct A : virtual V{
  12.   int x = 10;
  13.   int y = 7;
  14. };
  15.  
  16. struct B : virtual V, virtual W{
  17.  
  18. };
  19.  
  20. struct D : A, B {
  21.  
  22. };
  23.  
  24. int main() {
  25.   D d;
  26.   std::cout << d.x << d.y;
  27.  
  28.   return 0;
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top