Topic: implicit conversion of non-const member funcs


Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Wed, 12 Aug 2015 17:59:48 +0300
Raw View
On 12 August 2015 at 17:21, Matthew Woehlke <mwoehlke.floss@gmail.com> wrote:
> In fact, "complexities" is probably an understatement; if the member is
> in a different TU, there's no reasonable way you could implement such a
> feature.


Not to mention that since whether a member function does or does not
modify any other
members may be a run-time property, it's completely impossible to implement such
a feature.

--

---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Nevin Liber <nevin@eviloverlord.com>
Date: Wed, 12 Aug 2015 10:25:06 -0500
Raw View
--001a11376c9e2ce373051d1ed5f9
Content-Type: text/plain; charset=UTF-8

On 12 August 2015 at 09:21, Matthew Woehlke <mwoehlke.floss@gmail.com>
wrote:

> Er... no? Just make the member const in the first place. If it can be,
> it should be. If it can't be, it can't be, period. I find it extremely
> hard to imagine that this minor convenience is worth the complexities
> that would be involved to implement it, just so that you can be lazy
> about writing your code properly in the first place.
>

And the one place I'd want it might be for getters such as:

T& get() { return data_; }
T const& get() const { return data_; }

it won't do the correct thing, as one has to change the return type.
--
 Nevin ":-)" Liber  <mailto:nevin@eviloverlord.com>  (847) 691-1404

--

---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

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

<div dir=3D"ltr"><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">=
On 12 August 2015 at 09:21, Matthew Woehlke <span dir=3D"ltr">&lt;<a href=
=3D"mailto:mwoehlke.floss@gmail.com" target=3D"_blank">mwoehlke.floss@gmail=
..com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=3D":x9=
" class=3D"a3s" style=3D"overflow:hidden">Er... no? Just make the member co=
nst in the first place. If it can be,<br>
it should be. If it can&#39;t be, it can&#39;t be, period. I find it extrem=
ely<br>
hard to imagine that this minor convenience is worth the complexities<br>
that would be involved to implement it, just so that you can be lazy<br>
about writing your code properly in the first place.<br></div></blockquote>=
</div><br>And the one place I&#39;d want it might be for getters such as:</=
div><div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra">T&amp; =
get() { return data_; }</div><div class=3D"gmail_extra">T const&amp; get() =
const { return data_; }<br><br clear=3D"all"><div>it won&#39;t do the corre=
ct thing, as one has to change the return type.</div>-- <br><div class=3D"g=
mail_signature">=C2=A0Nevin &quot;:-)&quot; Liber=C2=A0 &lt;mailto:<a href=
=3D"mailto:nevin@eviloverlord.com" target=3D"_blank">nevin@eviloverlord.com=
</a>&gt;=C2=A0 (847) 691-1404</div>
</div></div>

<p></p>

-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a11376c9e2ce373051d1ed5f9--

.