Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #86102

Re: New feature in C++ wanted: friend limited to one function only in a class

From JiiPee <kerrttuPoistaTama11@gmail.com>
Newsgroups comp.lang.c++
Subject Re: New feature in C++ wanted: friend limited to one function only in a class
Date 2022-08-26 19:29 +0300
Organization A noiseless patient Spider
Message-ID <teasdj$uit$1@dont-email.me> (permalink)
References <te8afp$3mokm$1@dont-email.me> <tea2s8$3ufb4$1@dont-email.me>

Show all headers | View raw


On 26/08/2022 12:13, Paavo Helde wrote:
 > class Child1 {
 > public:
 > Parent* m_parent{ nullptr }; // later initialized ...
 > void foo3() {
 >      // Can access only foo()
 >      m_parent->foo(Child1Key{}); // this is OK
 >           // cannot access any other privates
 >      m_parent->foo2(Child2Key{}); // this is NOT OK
 > }
 > };

Thanks. a nice trick. Yes this is one of the best ways. I ll definitely 
keep this in my mind. I think I have seen the "key" pattern before, this 
seems similar.

Back to comp.lang.c++ | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

New feature in C++ wanted: friend limited to one function only in a class JiiPee <kerrttuPoistaTama11@gmail.com> - 2022-08-25 20:11 +0300
  Re: New feature in C++ wanted: friend limited to one function only in a class "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-08-25 20:13 +0200
    Re: New feature in C++ wanted: friend limited to one function only in a class JiiPee <kerrttuPoistaTama11@gmail.com> - 2022-08-25 23:13 +0300
  Re: New feature in C++ wanted: friend limited to one function only in a class JiiPee <kerrttuPoistaTama11@gmail.com> - 2022-08-25 23:11 +0300
  Re: New feature in C++ wanted: friend limited to one function only in a class Manfred <noname@add.invalid> - 2022-08-26 01:59 +0200
    Re: New feature in C++ wanted: friend limited to one function only in a class JiiPee <kerrttuPoistaTama11@gmail.com> - 2022-08-26 07:19 +0300
    Re: New feature in C++ wanted: friend limited to one function only in a class JiiPee <kerrttuPoistaTama11@gmail.com> - 2022-08-26 07:25 +0300
  Re: New feature in C++ wanted: friend limited to one function only in a class Paavo Helde <eesnimi@osa.pri.ee> - 2022-08-26 12:13 +0300
    Re: New feature in C++ wanted: friend limited to one function only in a class JiiPee <kerrttuPoistaTama11@gmail.com> - 2022-08-26 19:29 +0300
      Re: New feature in C++ wanted: friend limited to one function only in a class Paavo Helde <eesnimi@osa.pri.ee> - 2022-08-26 20:49 +0300
  Re: New feature in C++ wanted: friend limited to one function only in a class Michael S <already5chosen@yahoo.com> - 2022-08-26 03:55 -0700

csiph-web