home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 32,883 of 33,346   
   =?UTF-8?Q?Tobias=20M=C3=BCller?= to Seungbeom Kim   
   Re: Virtual base class and friend   
   01 Mar 13 09:57:42   
   
   1fa56f5d   
   From: troplin@bluewin.ch   
      
   Seungbeom Kim  wrote:   
   > On 2013-02-28 04:16, omveer wrote:   
   >> Thanks to Tobias Müller. I got below response.   
      
   That was in comp.lang.c++...   
      
   >> class D : public B, public C   
   >> {   
   >> public:   
   >>      // D() : B(), C() {}      // -> Error, the A subobject   
   >>                                  // is the same for B and C   
   >>                                  // and can only be   
   >>                                  // constructed once. But use   
   >>                                  // A() or A(4)?   
   >   
   > This is not an error, because it needs to construct A and the default   
   > constructor of A is accessible from D. It doesn't matter how the c'tors   
   > of B and C are defined to construct A; they are simply ignored.   
      
   Good catch, that was a bad example. But I think the OP still got the point.   
      
   Tobi   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca