Topic: Could "dumb" pointer (N3740) be implemented using
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Sun, 1 Sep 2013 10:32:27 +0200
Raw View
--047d7b2e477cb35eac04e54e4bdb
Content-Type: text/plain; charset=ISO-8859-1
All is in the subject:
Can an implementation using strong typedefs
http://isocpp.org/files/papers/n3741.pdf
be equivalent to the current dumb pointer specification:
http://isocpp.org/files/papers/n3740.pdf
?
That is, something like:
template< typename T >
using dumb_ptr = private T* { // or maybe protected is more correct?
dumb_ptr() { *this = nullptr; } // necessary for helping
correctness, but have a minor performance cost
};
At first it looks likely but I'm not an expert in the standard wording so I
might have missed something.
If I'm correct, then it would be easy to define other kind of pointer names
that just differ in the
documentation -through the name- but are not compatible. It would be useful
for both library
implementers and end-users.
Joel Lamotte
--
---
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/.
--047d7b2e477cb35eac04e54e4bdb
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">All is in the subject:<br>Can an implementation using stro=
ng typedefs=A0<a href=3D"http://isocpp.org/files/papers/n3741.pdf">http://i=
socpp.org/files/papers/n3741.pdf</a><br>be equivalent to the current dumb p=
ointer specification:=A0<a href=3D"http://isocpp.org/files/papers/n3740.pdf=
">http://isocpp.org/files/papers/n3740.pdf</a><br>
?<br><br>That is, something like:<div><br>template< typename T ></div=
><div>using dumb_ptr =3D private T* { =A0 =A0// or maybe protected is more =
correct?<br>=A0 =A0 =A0=A0dumb_ptr() { *this =3D nullptr; } =A0// necessary=
for helping correctness, but have a minor performance cost<br>
};<br><br>At first it looks likely but I'm not an expert in the standar=
d wording so I might have missed something.<br><br>If I'm correct, then=
it would be easy to define other kind of pointer names that just differ in=
the=A0<br>
documentation -through the name- but are not compatible. It would be useful=
for both library<br>implementers and end-users.<br><br>Joel Lamotte<div><b=
r></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" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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 />
--047d7b2e477cb35eac04e54e4bdb--
.
Author: tomaszkam@gmail.com
Date: Sun, 1 Sep 2013 01:54:39 -0700 (PDT)
Raw View
------=_Part_1280_25332920.1378025679550
Content-Type: text/plain; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable
I think it could be done if the current semantics is accepted - merged=20
single-object and array-element representation, but I think that this two=
=20
semantics should be spitted off.
See:=20
https://groups.google.com/a/isocpp.org/forum/?fromgroups#!topic/std-proposa=
ls/1V6Ez7RKrsk
W dniu niedziela, 1 wrze=B6nia 2013 10:32:27 UTC+2 u=BFytkownik Klaim - Jo=
=EBl=20
Lamotte napisa=B3:
>
> All is in the subject:
> Can an implementation using strong typedefs=20
> http://isocpp.org/files/papers/n3741.pdf
> be equivalent to the current dumb pointer specification:=20
> http://isocpp.org/files/papers/n3740.pdf
> ?
>
> That is, something like:
>
> template< typename T >
> using dumb_ptr =3D private T* { // or maybe protected is more correct?
> dumb_ptr() { *this =3D nullptr; } // necessary for helping=20
> correctness, but have a minor performance cost
> };
>
> At first it looks likely but I'm not an expert in the standard wording so=
=20
> I might have missed something.
>
> If I'm correct, then it would be easy to define other kind of pointer=20
> names that just differ in the=20
> documentation -through the name- but are not compatible. It would be=20
> useful for both library
> implementers and end-users.
>
> Joel Lamotte
>
>
--=20
---=20
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 e=
mail 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-proposa=
ls/.
------=_Part_1280_25332920.1378025679550
Content-Type: text/html; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I think it could be done if the current semantics is accep=
ted - merged single-object and array-element representation, but I think th=
at this two semantics should be spitted off.<br>See: https://groups.google.=
com/a/isocpp.org/forum/?fromgroups#!topic/std-proposals/1V6Ez7RKrsk<br><br>=
W dniu niedziela, 1 wrze=B6nia 2013 10:32:27 UTC+2 u=BFytkownik Klaim - Jo=
=EBl Lamotte napisa=B3:<blockquote class=3D"gmail_quote" style=3D"margin: 0=
;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div di=
r=3D"ltr">All is in the subject:<br>Can an implementation using strong type=
defs <a href=3D"http://isocpp.org/files/papers/n3741.pdf" target=3D"_b=
lank">http://isocpp.org/<wbr>files/papers/n3741.pdf</a><br>be equivalent to=
the current dumb pointer specification: <a href=3D"http://isocpp.org/=
files/papers/n3740.pdf" target=3D"_blank">http://isocpp.<wbr>org/files/pape=
rs/n3740.pdf</a><br>
?<br><br>That is, something like:<div><br>template< typename T ></div=
><div>using dumb_ptr =3D private T* { // or maybe protected is=
more correct?<br> dumb_ptr() { *this =3D nullptr;=
} // necessary for helping correctness, but have a minor performance=
cost<br>
};<br><br>At first it looks likely but I'm not an expert in the standard wo=
rding so I might have missed something.<br><br>If I'm correct, then it woul=
d be easy to define other kind of pointer names that just differ in the&nbs=
p;<br>
documentation -through the name- but are not compatible. It would be useful=
for both library<br>implementers and end-users.<br><br>Joel Lamotte<div><b=
r></div></div></div>
</blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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 />
------=_Part_1280_25332920.1378025679550--
.