Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #4451
| From | Qi <no@no.com> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: Is it standard that inner class inherits the outer class' friendship? |
| Date | 2011-04-30 22:08 +0800 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <iph578$qf9$2@speranza.aioe.org> (permalink) |
| References | <ipgn1u$qf9$1@speranza.aioe.org> <41dd0896-2e1b-4c2f-8d05-9b4b74e3c787@p13g2000yqh.googlegroups.com> |
On 2011-4-30 21:58, Saeed Amrollahi wrote:
>> class Graph {
>> private:
>> class cmp {
>> public:
>> int operator()(const Node&l, const Node&r) {
>> return (l.value - r.value); // without that friend, this
>> line can't compile
>> }
>> };
>>
>> };
>>
> 1. At first, I have to say the terms "inner class" and "outer class"
> aren't standard. It's somehow Java terms. C++ uses "nested class".
> 2. About your code, By the term "inner class", if you mean "nested
> class",
> you didn't use it. You have two classes: Node and Graph and you
> declared
> Graph as a friend of Node. May be, by inner you mean the logical
> inner,
> because each node of a graph is somehow the inner part of whole graph.
Thanks for the reply and sorry for the misunderstand.
For nested class (OK, now I will use this term, but then what's the
equivalence of "outer class"?), I mean Graph::cmp.
Sorry for any misunderstand.
--
WQ
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Is it standard that inner class inherits the outer class' friendship? Saeed Amrollahi <amrollahi.saeed@gmail.com> - 2011-04-30 06:58 -0700
Re: Is it standard that inner class inherits the outer class' friendship? Qi <no@no.com> - 2011-04-30 22:08 +0800
Re: Is it standard that inner class inherits the outer class' friendship? Saeed Amrollahi <amrollahi.saeed@gmail.com> - 2011-04-30 12:37 -0700
Re: Is it standard that inner class inherits the outer class' friendship? Qi <no@no.com> - 2011-05-01 12:57 +0800
csiph-web