Topic: write only pointers (opposite of 'const*')
Author: walter1234 <walter2bz@gmail.com>
Date: Tue, 16 Jun 2015 13:07:25 -0700 (PDT)
Raw View
------=_Part_12_1391901272.1434485245144
Content-Type: multipart/alternative;
boundary="----=_Part_13_1145311733.1434485245144"
------=_Part_13_1145311733.1434485245144
Content-Type: text/plain; charset=UTF-8
Thinking about abstractions which can be used for DMA buffers (& some
machines with the appropriate cache-control instructions), and better
expressing intent generally,
could we add a 'write only' pointer modifier to C++; it would essentially
be the opposite of 'const T*' . it would indicate that values may only be
written to the pointer, not read.
what could such a pointer be called,
would there be any chance of getting this into any mainstream compilers
with some verbose name e.g. __write_only T*
--
---
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/.
------=_Part_13_1145311733.1434485245144
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Thinking about abstractions which can be used for DMA buff=
ers (& some machines with the appropriate cache-control instructions), =
and better expressing intent generally,<div>could we add a 'write only' poi=
nter modifier to C++; it would essentially be the opposite of 'const T*' . =
it would indicate that values may only be written to the pointer, not read.=
</div><div><br></div><div>what could such a pointer be called, <=
/div><div>would there be any chance of getting this into any mainstream com=
pilers with some verbose name e.g. __write_only T*</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 <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 />
------=_Part_13_1145311733.1434485245144--
------=_Part_12_1391901272.1434485245144--
.
Author: "dgutson ." <danielgutson@gmail.com>
Date: Tue, 16 Jun 2015 17:14:15 -0300
Raw View
--001a11428cb6fea1c70518a83764
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
El 16/6/2015 17:07, "walter1234" <walter2bz@gmail.com> escribi=C3=B3:
>
> Thinking about abstractions which can be used for DMA buffers (& some
machines with the appropriate cache-control instructions), and better
expressing intent generally,
> could we add a 'write only' pointer modifier to C++; it would essentially
be the opposite of 'const T*' . it would indicate that values may only be
written to the pointer, not read.
>
> what could such a pointer be called,
> would there be any chance of getting this into any mainstream compilers
with some verbose name e.g. __write_only T*
Though I agree about the need and the problem, I strongly suggest either a
library version (a "smart" pointer wrapper) or an attribute (so it can be
applied to 'this' in methods declarations) rather than a type qualifier.
>
> --
>
> ---
> 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/.
--=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/.
--001a11428cb6fea1c70518a83764
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<p dir=3D"ltr"><br>
El 16/6/2015 17:07, "walter1234" <<a href=3D"mailto:walter2bz@=
gmail.com">walter2bz@gmail.com</a>> escribi=C3=B3:<br>
><br>
> Thinking about abstractions which can be used for DMA buffers (& s=
ome machines with the appropriate cache-control instructions), and better e=
xpressing intent generally,<br>
> could we add a 'write only' pointer modifier to C++; it would =
essentially be the opposite of 'const T*' . it would indicate that =
values may only be written to the pointer, not read.=C2=A0<br>
><br>
> what could such a pointer be called,=C2=A0<br>
> would there be any chance of getting this into any mainstream compiler=
s with some verbose name e.g. __write_only T*</p>
<p dir=3D"ltr">Though I agree about the need and the problem, I strongly su=
ggest either a library version (a "smart" pointer wrapper) or an =
attribute (so it can be applied to 'this' in methods declarations) =
rather than a type qualifier.<br></p>
<p dir=3D"ltr">><br>
> -- <br>
><br>
> --- <br>
> You received this message because you are subscribed to the Google Gro=
ups "ISO C++ Standard - Future Proposals" group.<br>
> To unsubscribe from this group and stop receiving emails from it, send=
an email to <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org">std-=
proposals+unsubscribe@isocpp.org</a>.<br>
> To post to this group, send email to <a href=3D"mailto:std-proposals@i=
socpp.org">std-proposals@isocpp.org</a>.<br>
> Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/g=
roup/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-propos=
als/</a>.<br>
</p>
<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 <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 />
--001a11428cb6fea1c70518a83764--
.
Author: Bo Persson <bop@gmb.dk>
Date: Wed, 17 Jun 2015 17:14:27 +0200
Raw View
On 2015-06-16 22:07, walter1234 wrote:
> Thinking about abstractions which can be used for DMA buffers (& some
> machines with the appropriate cache-control instructions), and better
> expressing intent generally,
> could we add a 'write only' pointer modifier to C++; it would
> essentially be the opposite of 'const T*' . it would indicate that
> values may only be written to the pointer, not read.
>
> what could such a pointer be called,
> would there be any chance of getting this into any mainstream compilers
> with some verbose name e.g. __write_only T*
>
Isn't that what an output iterator does?
http://en.cppreference.com/w/cpp/concept/OutputIterator
Bo Persson
--
---
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: "dgutson ." <danielgutson@gmail.com>
Date: Wed, 17 Jun 2015 12:43:36 -0300
Raw View
On Wed, Jun 17, 2015 at 12:14 PM, Bo Persson <bop@gmb.dk> wrote:
>
> On 2015-06-16 22:07, walter1234 wrote:
>>
>> Thinking about abstractions which can be used for DMA buffers (& some
>> machines with the appropriate cache-control instructions), and better
>> expressing intent generally,
>> could we add a 'write only' pointer modifier to C++; it would
>> essentially be the opposite of 'const T*' . it would indicate that
>> values may only be written to the pointer, not read.
>>
>> what could such a pointer be called,
>> would there be any chance of getting this into any mainstream compilers
>> with some verbose name e.g. __write_only T*
>>
>
> Isn't that what an output iterator does?
>
> http://en.cppreference.com/w/cpp/concept/OutputIterator
That doesn't help at method-level as a CV-like this qualifier.
Such a method would mean that the whole state of the instance
would be write-only during the method execution, and that such a method
could only call other "write only" methods.
>
>
> Bo Persson
>
>
>
>
> --
>
> --- You received this message because you are subscribed to the Google Gr=
oups "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-propo=
sals/.
--=20
Who=E2=80=99s got the sweetest disposition?
One guess, that=E2=80=99s who?
Who=E2=80=99d never, ever start an argument?
Who never shows a bit of temperament?
Who's never wrong but always right?
Who'd never dream of starting a fight?
Who get stuck with all the bad luck?
--=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/.
.
Author: walter lynsdale <walter2bz@gmail.com>
Date: Thu, 2 Jul 2015 10:42:54 +0100
Raw View
--e89a8ff254647ee6d00519e1438b
Content-Type: text/plain; charset=UTF-8
Another incredibly useful enhancement would be a fully Transitive Const. (i
kind of wish there was a compiler flag to just assume it is, its' probably
what people mean most of the time)
the point is it needs to be in the lower level output (e.g. available to
the compiler back end).
C/C++ is not only used on conventional machines but unconventional
architectures, e.g. machines with DMA, and even in the use in conventional
shared memory machines we can't fully express everything (e.g.
cache-hints). The more we can express the more the compiler can do for us,
the more we can communicate , and the more hardware can advance.
Wrapping smart -pointers and iterators does communicate more but doesn't
propagate to the back end, and does so at the cost of compile times and
extra boiler plate
--
---
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/.
--e89a8ff254647ee6d00519e1438b
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Another incredibly useful enhancement would be a full=
y Transitive Const. (i kind of wish there was a compiler flag to just assum=
e it is, its' probably what people mean most of the time)<br></div><div=
><br></div><div>the point is it needs to be in the lower level output (e.g.=
available to the compiler back end).=C2=A0</div><div><br></div><div>C/C++ =
is not only used on conventional machines but unconventional architectures,=
e.g. machines with DMA, and even in the use in conventional shared memory =
machines we can't fully express everything (e.g. cache-hints). The more=
we can express the more the compiler can do for us, the more we can commun=
icate , and the more hardware can advance.</div><div><br></div><div>Wrappin=
g smart -pointers and iterators does communicate more but doesn't propa=
gate to the back end, and does so at the cost of compile times and extra bo=
iler plate</div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote"><=
br></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 <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 />
--e89a8ff254647ee6d00519e1438b--
.
Author: Jonathan Coe <jonathanbcoe@gmail.com>
Date: Thu, 2 Jul 2015 10:47:24 +0100
Raw View
--Apple-Mail-B14F357F-77FF-4E70-8D8E-1EDCC379CC10
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
There's work on a library solution for transitive const : https://isocpp.or=
g/files/papers/N4388.html
This should be in library fundamentals TS.
Jon
> On 2 Jul 2015, at 10:42, walter lynsdale <walter2bz@gmail.com> wrote:
>=20
> Another incredibly useful enhancement would be a fully Transitive Const. =
(i kind of wish there was a compiler flag to just assume it is, its' probab=
ly what people mean most of the time)
>=20
> the point is it needs to be in the lower level output (e.g. available to =
the compiler back end).=20
>=20
> C/C++ is not only used on conventional machines but unconventional archit=
ectures, e.g. machines with DMA, and even in the use in conventional shared=
memory machines we can't fully express everything (e.g. cache-hints). The =
more we can express the more the compiler can do for us, the more we can co=
mmunicate , and the more hardware can advance.
>=20
> Wrapping smart -pointers and iterators does communicate more but doesn't =
propagate to the back end, and does so at the cost of compile times and ext=
ra boiler plate
>=20
>=20
> --=20
>=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=
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-propo=
sals/.
--=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/.
--Apple-Mail-B14F357F-77FF-4E70-8D8E-1EDCC379CC10
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 dir=3D"auto"><div>There's work on a library solution=
for transitive const : <a href=3D"https://isocpp.org/files/papers/N43=
88.html">https://isocpp.org/files/papers/N4388.html</a></div><div><br></div=
><div>This should be in library fundamentals TS.</div><div><br></div><div>J=
on<br><br><br></div><div><br>On 2 Jul 2015, at 10:42, walter lynsdale <<=
a href=3D"mailto:walter2bz@gmail.com">walter2bz@gmail.com</a>> wrote:<br=
><br></div><blockquote type=3D"cite"><div><div dir=3D"ltr"><div>Another inc=
redibly useful enhancement would be a fully Transitive Const. (i kind of wi=
sh there was a compiler flag to just assume it is, its' probably what peopl=
e mean most of the time)<br></div><div><br></div><div>the point is it needs=
to be in the lower level output (e.g. available to the compiler back end).=
</div><div><br></div><div>C/C++ is not only used on conventional mach=
ines but unconventional architectures, e.g. machines with DMA, and even in =
the use in conventional shared memory machines we can't fully express every=
thing (e.g. cache-hints). The more we can express the more the compiler can=
do for us, the more we can communicate , and the more hardware can advance=
..</div><div><br></div><div>Wrapping smart -pointers and iterators does comm=
unicate more but doesn't propagate to the back end, and does so at the cost=
of compile times and extra boiler plate</div><div class=3D"gmail_extra"><b=
r><div class=3D"gmail_quote"><br></div></div></div>
<p></p>
-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" 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>
</div></blockquote></body></html>
<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 <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 />
--Apple-Mail-B14F357F-77FF-4E70-8D8E-1EDCC379CC10--
.