Topic: rationale for hiding data/function members and idea


Author: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Date: Wed, 11 Jan 2017 08:08:09 +0100
Raw View
This is a multi-part message in MIME format.
--------------5E248FB18771CFE461DDDA5D
Content-Type: text/plain; charset=UTF-8; format=flowed

Hi,


Could someone give me a good use case, the rationale, for hiding data
members

http://melpon.org/wandbox/permlink/mXshdsg9A3dY53Jn

I understand that the language allows shadowing a variable in an inner
scope of a function, but hiding base data members seems to me more risky.

In the same way we have override when we are overriding a virtual
function and we will get an error if there is no virtual function to
override, we could have some kind of "hide"  data member. The compiler
could then report a warning when the data member is hidden without an
explicit "hide".

I believe the same could apply to hidden overloaded functions.

Vicente



--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/390678fc-8b01-cdee-579c-0e4d874906a7%40wanadoo.fr.

--------------5E248FB18771CFE461DDDA5D
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html>
  <head>
    <meta http-equiv=3D"content-type" content=3D"text/html; charset=3Dutf-8=
">
  </head>
  <body bgcolor=3D"#FFFFFF" text=3D"#000000">
    <p><font size=3D"+1">Hi,</font></p>
    <p><font size=3D"+1"><br>
      </font></p>
    <p><font size=3D"+1">Could someone give me a good use case, the
        rationale, for hiding data members</font></p>
    <p><a class=3D"moz-txt-link-freetext"
        href=3D"http://melpon.org/wandbox/permlink/mXshdsg9A3dY53Jn">http:/=
/melpon.org/wandbox/permlink/mXshdsg9A3dY53Jn</a></p>
    <p>I understand that the language allows shadowing a variable in an
      inner scope of a function, but hiding base data members seems to
      me more risky.</p>
    <p>In the same way we have override when we are overriding a virtual
      function and we will get an error if there is no virtual function
      to override, we could have some kind of "hide"=C2=A0 data member. The
      compiler could then report a warning when the data member is
      hidden without an explicit "hide".</p>
    <p>I believe the same could apply to hidden overloaded functions.<br>
    </p>
    <p>Vicente<br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
  </body>
</html>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/390678fc-8b01-cdee-579c-0e4d874906a7%=
40wanadoo.fr?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/390678fc-8b01-cdee-579c-0e4d874906a7=
%40wanadoo.fr</a>.<br />

--------------5E248FB18771CFE461DDDA5D--

.