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 31,729 of 33,346   
   =?ISO-8859-1?Q?Daniel_Kr=FCgler?= to pjacobi   
   Re: Private member functions cannot be g   
   09 Dec 11 09:25:40   
   
   273aefe0   
   From: daniel.kruegler@googlemail.com   
      
   On 2011-12-09 06:05, pjacobi wrote:   
   > It seems GCC and MSVC agree on this:   
   >   
   > When f is is a private member of class Foo, then class class Bar   
   > cannot declare Foo::f to be a function friend.   
   >   
   > Isn't this a bit strange? That function declaration would not give Bar   
   > access to Foo internals, just the other way around, as any friend   
   > declaration does.   
      
   I agree that the current rules are unfortunate in this regard.   
      
   > So, is it really forbidden by the standard?   
      
   It seems so. As of 11.3 p9:   
      
   "A name nominated by a friend declaration shall be accessible in the   
   scope of the class containing the friend declaration."   
      
   HTH & Greetings from Bremen,   
      
   Daniel Krügler   
      
      
   --   
         [ 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