Topic: Are there any existing enum.method()


Author: Nevin Liber <nevin@cplusplusguy.com>
Date: Sat, 26 Dec 2015 12:12:12 -0600
Raw View
--001a11457a322476b00527d10571
Content-Type: text/plain; charset=UTF-8

On 26 December 2015 at 10:32, Nicol Bolas <jmckesson@gmail.com> wrote:

> Is there some reason why such a method specifically *needs* to be a
> member function? Given unified function call syntax, you're going to be
> seeing a lot more `f(x)` than `x.f()` in the future.
>

I would not assume that.

The only way users of a library can guarantee that they are calling the
correct function is to use the same call syntax that the library author
implemented, because f(x) may or may not call something different than
x.f(), and such a difference may, for instance, be dependent on something
as fragile as what headers are included.

Unfortunately, whenever I've brought this objection up in EWG, it's been
misconstrued as wanting to force my users to use a particular syntax.  I
don't care what syntax my users use; I do care that they call what they
intend to call.  But I digress...
--
 Nevin ":-)" Liber  <mailto:nevin@cplusplusguy.com <nevin@eviloverlord.com>>
+1-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 https://groups.google.com/a/isocpp.org/group/std-proposals/.

--001a11457a322476b00527d10571
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 26 December 2015 at 10:32, Nicol Bolas <span dir=3D"ltr">&lt;<a href=3D"=
mailto:jmckesson@gmail.com" target=3D"_blank">jmckesson@gmail.com</a>&gt;</=
span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8e=
x;border-left:1px #ccc solid;padding-left:1ex"><div>Is there some reason wh=
y such a method specifically <i>needs</i> to be a member function? Given un=
ified function call syntax, you&#39;re going to be seeing a lot more `f(x)`=
 than `x.f()` in the future.<br></div></blockquote></div><br>I would not as=
sume that.</div><div class=3D"gmail_extra"><br></div><div class=3D"gmail_ex=
tra">The only way users of a library can guarantee that they are calling th=
e correct function is to use the same call syntax that the library author i=
mplemented, because f(x) may or may not call something different than x.f()=
, and such a difference may, for instance, be dependent on something as fra=
gile as what headers are included.</div><div class=3D"gmail_extra"><br></di=
v><div class=3D"gmail_extra">Unfortunately, whenever I&#39;ve brought this =
objection up in EWG, it&#39;s been misconstrued as wanting to force my user=
s to use a particular syntax.=C2=A0 I don&#39;t care what syntax my users u=
se; I do care that they call what they intend to call.=C2=A0 But I digress.=
...<br>-- <br><div><div dir=3D"ltr">=C2=A0Nevin &quot;:-)&quot; Liber=C2=A0 =
&lt;mailto:<a href=3D"mailto:nevin@eviloverlord.com" target=3D"_blank">nevi=
n@cplusplusguy.com</a>&gt;=C2=A0 <a href=3D"tel:%2B1-847-691-1404" value=3D=
"+18476911404" target=3D"_blank">+1-847-691-1404</a><br></div></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"https://groups.google.com/a/isocpp.org/group=
/std-proposals/">https://groups.google.com/a/isocpp.org/group/std-proposals=
/</a>.<br />

--001a11457a322476b00527d10571--

.