Topic: Make void{} do what you think it does
Author: Paul Hampson <paul.hampson@pobox.com>
Date: Sat, 13 May 2017 08:12:30 -0700 (PDT)
Raw View
------=_Part_461_169681495.1494688350756
Content-Type: multipart/alternative;
boundary="----=_Part_462_1538996945.1494688350757"
------=_Part_462_1538996945.1494688350757
Content-Type: text/plain; charset="UTF-8"
Based on feedback from a successful lightning talk at ACCU2017, I've
written up a proposal to make void{} do always what void() does in
expression context, like any other type.
My draft is visible at https://tbble.github.io/WG21-void/dxxxxr0.html, and
I've attached the current version.
I realise this is a rather small thing to write a proposal for (it maybe
should have been a defect report?) but it's also practice for me, as I'm
helping out with another larger proposal
(https://github.com/WG21-SG14/SG14-comparing-virtual-functions) and needed
to get some practice time in with the tools, writing, and the process
itself.
--
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/c77bd9db-1be3-4a99-bd30-fb50ea074176%40isocpp.org.
------=_Part_462_1538996945.1494688350757
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Based on feedback from a successful lightning talk at ACCU=
2017, I've written up a proposal to make <font face=3D"times new roman,=
serif">void{}</font> do always what <font face=3D"times new roman, serif">=
void()</font> does in expression context, like any other type.<div><br></di=
v><div>My draft is visible at=C2=A0https://tbble.github.io/WG21-void/dxxxxr=
0.html, and I've attached the current version.</div><div><br></div><div=
>I realise this is a rather small thing to write a proposal for (it maybe s=
hould have been a defect report?) but it's also practice for me, as I&#=
39;m helping out with another larger proposal (https://github.com/WG21-SG14=
/SG14-comparing-virtual-functions) and needed to get some practice time in =
with the tools, writing, and the process itself.</div></div>
<p></p>
-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/c77bd9db-1be3-4a99-bd30-fb50ea074176%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/c77bd9db-1be3-4a99-bd30-fb50ea074176=
%40isocpp.org</a>.<br />
------=_Part_462_1538996945.1494688350757--
------=_Part_461_169681495.1494688350756
Content-Type: text/html; charset=UTF-8;
name="dxxxxr0d0_ Unambiguous prvalue _code_void__code_.html"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="dxxxxr0d0_ Unambiguous prvalue _code_void__code_.html"
X-Attachment-Id: 5be56a7e-a554-4920-8a7e-c61d08969516
Content-ID: <5be56a7e-a554-4920-8a7e-c61d08969516>
<!DOCTYPE html>
<!-- saved from url=3D(0046)https://tbble.github.io/WG21-void/dxxxxr0.html =
-->
<html lang=3D"en"><head><meta http-equiv=3D"Content-Type" content=3D"text/h=
tml; charset=3DUTF-8">
=20
<meta content=3D"width=3Ddevice-width, initial-scale=3D1, shrink-to-fit=
=3Dno" name=3D"viewport">
<title>dxxxxr0d0: Unambiguous prvalue <code>void</code></titl=
e>
<style data-fill-with=3D"stylesheet">/*************************************=
*****************************************
* Style sheet for the W3C specifications =
*
*
* Special classes handled by this style sheet include:
*
* Indices
* - .toc for the Table of Contents (<ol class=3D"toc">)
* + <span class=3D"secno"> for the section numbers
* - #toc for the Table of Contents (<nav id=3D"toc">)
* - ul.index for Indices (<a href=3D"#ref">term</a><span>, in =C2=A7N.M<=
/span>)
* - table.index for Index Tables (e.g. for properties or elements)
*
* Structural Markup
* - table.data for general data tables
* -> use 'scope' attribute, <colgroup>, <thead>, and <tbody> for best =
results !
* -> use <table class=3D'complex data'> for extra-complex tables
* -> use <td class=3D'long'> for paragraph-length cell content
* -> use <td class=3D'pre'> when manual line breaks/indentation would =
help readability
* - dl.switch for switch statements
* - ol.algorithm for algorithms (helps to visualize nesting)
* - .figure and .caption (HTML4) and figure and figcaption (HTML5)
* -> .sidefigure for right-floated figures
* - ins/del
*
* Code
* - pre and code
*
* Special Sections
* - .note for informative notes (div, p, span, aside, =
details)
* - .example for informative examples (div, p, pre, span)
* - .issue for issues (div, p, span)
* - .assertion for assertions (div, p, span)
* - .advisement for loud normative statements (div, p, strong)
* - .annoying-warning for spec obsoletion notices (div, aside, details)
*
* Definition Boxes
* - pre.def for WebIDL definitions
* - table.def for tables that define other entities (e.g. CSS properties=
)
* - dl.def for definition lists that define other entitles (e.g. HTML=
elements)
*
* Numbering
* - .secno for section numbers in .toc and headings (<span class=3D'secn=
o'>3.2</span>)
* - .marker for source-inserted example/figure/issue numbers (<span clas=
s=3D'marker'>Issue 4</span>)
* - ::before styled for CSS-generated issue/example/figure numbers:
* -> Documents wishing to use this only need to add
* figcaption::before,
* .caption::before { content: "Figure " counter(figure) " "; }
* .example::before { content: "Example " counter(example) " "; }
* .issue::before { content: "Issue " counter(issue) " "; }
*
* Header Stuff (ignore, just don't conflict with these classes)
* - .head for the header
* - .copyright for the copyright
*
* Miscellaneous
* - .overlarge for things that should be as wide as possible, even if
* that overflows the body text area. This can be used on an item or
* on its container, depending on the effect desired.
* Note that this styling basically doesn't help at all when printing,
* since A4 paper isn't much wider than the max-width here.
* It's better to design things to fit into a narrower measure if possi=
ble.
* - js-added ToC jump links (see fixup.js)
*
**************************************************************************=
****/
/**************************************************************************=
****/
/* Body =
*/
/**************************************************************************=
****/
=09body {
=09=09counter-reset: example figure issue;
=09=09/* Layout */
=09=09max-width: 50em; /* limit line length to 50em for reada=
bility */
=09=09margin: 0 auto; /* center text within page =
*/
=09=09padding: 1.6em 1.5em 2em 50px; /* assume 16px font size for downlevel=
clients */
=09=09padding: 1.6em 1.5em 2em calc(26px + 1.5em); /* leave space for statu=
s flag */
=09=09/* Typography */
=09=09line-height: 1.5;
=09=09font-family: sans-serif;
=09=09widows: 2;
=09=09orphans: 2;
=09=09word-wrap: break-word;
=09=09overflow-wrap: break-word;
=09=09hyphens: auto;
=09=09/* Colors */
=09=09color: black;
=09=09background: white top left fixed no-repeat;
=09=09background-size: 25px auto;
=09}
/**************************************************************************=
****/
/* Front Matter & Navigation =
*/
/**************************************************************************=
****/
/** Header ****************************************************************=
****/
=09div.head { margin-bottom: 1em }
=09div.head hr { border-style: solid; }
=09div.head h1 {
=09=09font-weight: bold;
=09=09margin: 0 0 .1em;
=09=09font-size: 220%;
=09}
=09div.head h2 { margin-bottom: 1.5em;}
/** W3C Logo **************************************************************=
****/
=09.head .logo {
=09=09float: right;
=09=09margin: 0.4rem 0 0.2rem .4rem;
=09}
=09.head img[src*=3D"logos/W3C"] {
=09=09display: block;
=09=09border: solid #1a5e9a;
=09=09border-width: .65rem .7rem .6rem;
=09=09border-radius: .4rem;
=09=09background: #1a5e9a;
=09=09color: white;
=09=09font-weight: bold;
=09}
=09.head a:hover > img[src*=3D"logos/W3C"],
=09.head a:focus > img[src*=3D"logos/W3C"] {
=09=09opacity: .8;
=09}
=09.head a:active > img[src*=3D"logos/W3C"] {
=09=09background: #c00;
=09=09border-color: #c00;
=09}
=09/* see also additional rules in Link Styling section */
/** Copyright *************************************************************=
****/
=09p.copyright,
=09p.copyright small { font-size: small }
/** Back to Top / ToC Toggle **********************************************=
****/
=09@media print {
=09=09#toc-nav {
=09=09=09display: none;
=09=09}
=09}
=09@media not print {
=09=09#toc-nav {
=09=09=09position: fixed;
=09=09=09z-index: 2;
=09=09=09bottom: 0; left: 0;
=09=09=09margin: 0;
=09=09=09min-width: 1.33em;
=09=09=09border-top-right-radius: 2rem;
=09=09=09box-shadow: 0 0 2px;
=09=09=09font-size: 1.5em;
=09=09=09color: black;
=09=09}
=09=09#toc-nav > a {
=09=09=09display: block;
=09=09=09white-space: nowrap;
=09=09=09height: 1.33em;
=09=09=09padding: .1em 0.3em;
=09=09=09margin: 0;
=09=09=09background: white;
=09=09=09box-shadow: 0 0 2px;
=09=09=09border: none;
=09=09=09border-top-right-radius: 1.33em;
=09=09=09background: white;
=09=09}
=09=09#toc-nav > #toc-jump {
=09=09=09padding-bottom: 2em;
=09=09=09margin-bottom: -1.9em;
=09=09}
=09=09#toc-nav > a:hover,
=09=09#toc-nav > a:focus {
=09=09=09background: #f8f8f8;
=09=09}
=09=09#toc-nav > a:not(:hover):not(:focus) {
=09=09=09color: #707070;
=09=09}
=09=09/* statusbar gets in the way on keyboard focus; remove once browsers =
fix */
=09=09#toc-nav > a[href=3D"#toc"]:not(:hover):focus:last-child {
=09=09=09padding-bottom: 1.5rem;
=09=09}
=09=09#toc-nav:not(:hover) > a:not(:focus) > span + span {
=09=09=09/* Ideally this uses :focus-within on #toc-nav */
=09=09=09display: none;
=09=09}
=09=09#toc-nav > a > span + span {
=09=09=09padding-right: 0.2em;
=09=09}
=09=09#toc-toggle-inline {
=09=09=09vertical-align: 0.05em;
=09=09=09font-size: 80%;
=09=09=09color: gray;
=09=09=09color: hsla(203,20%,40%,.7);
=09=09=09border-style: none;
=09=09=09background: transparent;
=09=09=09position: relative;
=09=09}
=09=09#toc-toggle-inline:hover:not(:active),
=09=09#toc-toggle-inline:focus:not(:active) {
=09=09=09text-shadow: 1px 1px silver;
=09=09=09top: -1px;
=09=09=09left: -1px;
=09=09}
=09=09#toc-nav :active {
=09=09=09color: #C00;
=09=09}
=09}
/** ToC Sidebar ***********************************************************=
****/
=09/* Floating sidebar */
=09@media screen {
=09=09body.toc-sidebar #toc {
=09=09=09position: fixed;
=09=09=09top: 0; bottom: 0;
=09=09=09left: 0;
=09=09=09width: 23.5em;
=09=09=09max-width: 80%;
=09=09=09max-width: calc(100% - 2em - 26px);
=09=09=09overflow: auto;
=09=09=09padding: 0 1em;
=09=09=09padding-left: 42px;
=09=09=09padding-left: calc(1em + 26px);
=09=09=09background: inherit;
=09=09=09background-color: #f7f8f9;
=09=09=09z-index: 1;
=09=09=09box-shadow: -.1em 0 .25em rgba(0,0,0,.1) inset;
=09=09}
=09=09body.toc-sidebar #toc h2 {
=09=09=09margin-top: .8rem;
=09=09=09font-variant: small-caps;
=09=09=09font-variant: all-small-caps;
=09=09=09text-transform: lowercase;
=09=09=09font-weight: bold;
=09=09=09color: gray;
=09=09=09color: hsla(203,20%,40%,.7);
=09=09}
=09=09body.toc-sidebar #toc-jump:not(:focus) {
=09=09=09width: 0;
=09=09=09height: 0;
=09=09=09padding: 0;
=09=09=09position: absolute;
=09=09=09overflow: hidden;
=09=09}
=09}
=09/* Hide main scroller when only the ToC is visible anyway */
=09@media screen and (max-width: 28em) {
=09=09body.toc-sidebar {
=09=09=09overflow: hidden;
=09=09}
=09}
=09/* Sidebar with its own space */
=09@media screen and (min-width: 78em) {
=09=09body:not(.toc-inline) #toc {
=09=09=09position: fixed;
=09=09=09top: 0; bottom: 0;
=09=09=09left: 0;
=09=09=09width: 23.5em;
=09=09=09overflow: auto;
=09=09=09padding: 0 1em;
=09=09=09padding-left: 42px;
=09=09=09padding-left: calc(1em + 26px);
=09=09=09background: inherit;
=09=09=09background-color: #f7f8f9;
=09=09=09z-index: 1;
=09=09=09box-shadow: -.1em 0 .25em rgba(0,0,0,.1) inset;
=09=09}
=09=09body:not(.toc-inline) #toc h2 {
=09=09=09margin-top: .8rem;
=09=09=09font-variant: small-caps;
=09=09=09font-variant: all-small-caps;
=09=09=09text-transform: lowercase;
=09=09=09font-weight: bold;
=09=09=09color: gray;
=09=09=09color: hsla(203,20%,40%,.7);
=09=09}
=09=09body:not(.toc-inline) {
=09=09=09padding-left: 29em;
=09=09}
=09=09/* See also Overflow section at the bottom */
=09=09body:not(.toc-inline) #toc-jump:not(:focus) {
=09=09=09width: 0;
=09=09=09height: 0;
=09=09=09padding: 0;
=09=09=09position: absolute;
=09=09=09overflow: hidden;
=09=09}
=09}
=09@media screen and (min-width: 90em) {
=09=09body:not(.toc-inline) {
=09=09=09margin: 0 4em;
=09=09}
=09}
/**************************************************************************=
****/
/* Sectioning =
*/
/**************************************************************************=
****/
/** Headings **************************************************************=
****/
=09h1, h2, h3, h4, h5, h6, dt {
=09=09page-break-after: avoid;
=09=09page-break-inside: avoid;
=09=09font: 100% sans-serif; /* Reset all font styling to clear out UA st=
yles */
=09=09font-family: inherit; /* Inherit the font family. */
=09=09line-height: 1.2; /* Keep wrapped headings compact */
=09=09hyphens: manual; /* Hyphenated headings look weird */
=09}
=09h2, h3, h4, h5, h6 {
=09=09margin-top: 3rem;
=09}
=09h1, h2, h3 {
=09=09color: #005A9C;
=09=09background: transparent;
=09}
=09h1 { font-size: 170%; }
=09h2 { font-size: 140%; }
=09h3 { font-size: 120%; }
=09h4 { font-weight: bold; }
=09h5 { font-style: italic; }
=09h6 { font-variant: small-caps; }
=09dt { font-weight: bold; }
/** Subheadings ***********************************************************=
****/
=09h1 + h2,
=09#subtitle {
=09=09/* #subtitle is a subtitle in an H2 under the H1 */
=09=09margin-top: 0;
=09}
=09h2 + h3,
=09h3 + h4,
=09h4 + h5,
=09h5 + h6 {
=09=09margin-top: 1.2em; /* =3D 1 x line-height */
=09}
/** Section divider *******************************************************=
****/
=09:not(.head) > hr {
=09=09font-size: 1.5em;
=09=09text-align: center;
=09=09margin: 1em auto;
=09=09height: auto;
=09=09border: transparent solid 0;
=09=09background: transparent;
=09}
=09:not(.head) > hr::before {
=09=09content: "\2727\2003\2003\2727\2003\2003\2727";
=09}
/**************************************************************************=
****/
/* Paragraphs and Lists =
*/
/**************************************************************************=
****/
=09p {
=09=09margin: 1em 0;
=09}
=09dd > p:first-child,
=09li > p:first-child {
=09=09margin-top: 0;
=09}
=09ul, ol {
=09=09margin-left: 0;
=09=09padding-left: 2em;
=09}
=09li {
=09=09margin: 0.25em 0 0.5em;
=09=09padding: 0;
=09}
=09dl dd {
=09=09margin: 0 0 .5em 2em;
=09}
=09.head dd + dd { /* compact for header */
=09=09margin-top: -.5em;
=09}
=09/* Style for algorithms */
=09ol.algorithm ol:not(.algorithm),
=09.algorithm > ol ol:not(.algorithm) {
=09 border-left: 0.5em solid #DEF;
=09}
=09/* Put nice boxes around each algorithm. */
=09[data-algorithm]:not(.heading) {
=09 padding: .5em;
=09 border: thin solid #ddd; border-radius: .5em;
=09 margin: .5em calc(-0.5em - 1px);
=09}
=09[data-algorithm]:not(.heading) > :first-child {
=09 margin-top: 0;
=09}
=09[data-algorithm]:not(.heading) > :last-child {
=09 margin-bottom: 0;
=09}
=09/* Style for switch/case <dl>s */
=09dl.switch > dd > ol.only,
=09dl.switch > dd > .only > ol {
=09 margin-left: 0;
=09}
=09dl.switch > dd > ol.algorithm,
=09dl.switch > dd > .algorithm > ol {
=09 margin-left: -2em;
=09}
=09dl.switch {
=09 padding-left: 2em;
=09}
=09dl.switch > dt {
=09 text-indent: -1.5em;
=09 margin-top: 1em;
=09}
=09dl.switch > dt + dt {
=09 margin-top: 0;
=09}
=09dl.switch > dt::before {
=09 content: '\21AA';
=09 padding: 0 0.5em 0 0;
=09 display: inline-block;
=09 width: 1em;
=09 text-align: right;
=09 line-height: 0.5em;
=09}
/** Terminology Markup ****************************************************=
****/
/**************************************************************************=
****/
/* Inline Markup =
*/
/**************************************************************************=
****/
/** Terminology Markup ****************************************************=
****/
=09dfn { /* Defining instance */
=09=09font-weight: bolder;
=09}
=09a > i { /* Instance of term */
=09=09font-style: normal;
=09}
=09dt dfn code, code.idl {
=09=09font-size: normal;
=09}
=09dfn var {
=09=09font-style: normal;
=09}
/** Change Marking ********************************************************=
****/
=09del { color: red; text-decoration: line-through; }
=09ins { color: #080; text-decoration: underline; }
/** Miscellaneous improvements to inline formatting ***********************=
****/
=09sup {
=09=09vertical-align: super;
=09=09font-size: 80%
=09}
/**************************************************************************=
****/
/* Code =
*/
/**************************************************************************=
****/
/** General monospace/pre rules *******************************************=
****/
=09pre, code, samp {
=09=09font-family: Menlo, Consolas, "DejaVu Sans Mono", Monaco, monospace;
=09=09font-size: .9em;
=09=09page-break-inside: avoid;
=09=09hyphens: none;
=09=09text-transform: none;
=09}
=09pre code,
=09code code {
=09=09font-size: 100%;
=09}
=09pre {
=09=09margin-top: 1em;
=09=09margin-bottom: 1em;
=09=09overflow: auto;
=09}
/** Inline Code fragments *************************************************=
****/
/* Do something nice. */
/**************************************************************************=
****/
/* Links =
*/
/**************************************************************************=
****/
/** General Hyperlinks ****************************************************=
****/
=09/* We hyperlink a lot, so make it less intrusive */
=09a[href] {
=09=09color: #034575;
=09=09text-decoration: none;
=09=09border-bottom: 1px solid #707070;
=09=09/* Need a bit of extending for it to look okay */
=09=09padding: 0 1px 0;
=09=09margin: 0 -1px 0;
=09}
=09a:visited {
=09=09border-bottom-color: #BBB;
=09}
=09/* Use distinguishing colors when user is interacting with the link */
=09a[href]:focus,
=09a[href]:hover {
=09=09background: #f8f8f8;
=09=09background: rgba(75%, 75%, 75%, .25);
=09=09border-bottom-width: 3px;
=09=09margin-bottom: -2px;
=09}
=09a[href]:active {
=09=09color: #C00;
=09=09border-color: #C00;
=09}
=09/* Backout above styling for W3C logo */
=09.head .logo,
=09.head .logo a {
=09=09border: none;
=09=09text-decoration: none;
=09=09background: transparent;
=09}
/**************************************************************************=
****/
/* Images =
*/
/**************************************************************************=
****/
=09img {
=09=09border-style: none;
=09}
=09/* For autogen numbers, add
=09 .caption::before, figcaption::before { content: "Figure " counter(fig=
ure) ". "; }
=09*/
=09figure, .figure, .sidefigure {
=09=09page-break-inside: avoid;
=09=09text-align: center;
=09=09margin: 2.5em 0;
=09}
=09.figure img, .sidefigure img, figure img,
=09.figure object, .sidefigure object, figure object {
=09=09max-width: 100%;
=09=09margin: auto;
=09}
=09.figure pre, .sidefigure pre, figure pre {
=09=09text-align: left;
=09=09display: table;
=09=09margin: 1em auto;
=09}
=09.figure table, figure table {
=09=09margin: auto;
=09}
=09@media screen and (min-width: 20em) {
=09=09.sidefigure {
=09=09=09float: right;
=09=09=09width: 50%;
=09=09=09margin: 0 0 0.5em 0.5em
=09=09}
=09}
=09.caption, figcaption, caption {
=09=09font-style: italic;
=09=09font-size: 90%;
=09}
=09.caption::before, figcaption::before, figcaption > .marker {
=09=09font-weight: bold;
=09}
=09.caption, figcaption {
=09=09counter-increment: figure;
=09}
=09/* DL list is indented 2em, but figure inside it is not */
=09dd > .figure, dd > figure { margin-left: -2em }
/**************************************************************************=
****/
/* Colored Boxes =
*/
/**************************************************************************=
****/
=09.issue, .note, .example, .assertion, .advisement, blockquote {
=09=09padding: .5em;
=09=09border: .5em;
=09=09border-left-style: solid;
=09=09page-break-inside: avoid;
=09}
=09span.issue, span.note {
=09=09padding: .1em .5em .15em;
=09=09border-right-style: solid;
=09}
=09.issue,
=09.note,
=09.example,
=09.advisement,
=09.assertion,
=09blockquote {
=09=09margin: 1em auto;
=09}
=09.note > p:first-child,
=09.issue > p:first-child,
=09blockquote > :first-child {
=09=09margin-top: 0;
=09}
=09blockquote > :last-child {
=09=09margin-bottom: 0;
=09}
/** Blockquotes ***********************************************************=
****/
=09blockquote {
=09=09border-color: silver;
=09}
/** Open issue ************************************************************=
****/
=09.issue {
=09=09border-color: #E05252;
=09=09background: #FBE9E9;
=09=09counter-increment: issue;
=09=09overflow: auto;
=09}
=09.issue::before, .issue > .marker {
=09=09text-transform: uppercase;
=09=09color: #AE1E1E;
=09=09padding-right: 1em;
=09=09text-transform: uppercase;
=09}
=09/* Add .issue::before { content: "Issue " counter(issue) " "; } for auto=
gen numbers,
=09 or use class=3D"marker" to mark up the issue number in source. */
/** Example ***************************************************************=
****/
=09.example {
=09=09border-color: #E0CB52;
=09=09background: #FCFAEE;
=09=09counter-increment: example;
=09=09overflow: auto;
=09=09clear: both;
=09}
=09.example::before, .example > .marker {
=09=09text-transform: uppercase;
=09=09color: #827017;
=09=09min-width: 7.5em;
=09=09display: block;
=09}
=09/* Add .example::before { content: "Example " counter(example) " "; } fo=
r autogen numbers,
=09 or use class=3D"marker" to mark up the example number in source. */
/** Non-normative Note ****************************************************=
****/
=09.note {
=09=09border-color: #52E052;
=09=09background: #E9FBE9;
=09=09overflow: auto;
=09}
=09.note::before, .note > .marker,
=09details.note > summary::before,
=09details.note > summary > .marker {
=09=09text-transform: uppercase;
=09=09display: block;
=09=09color: hsl(120, 70%, 30%);
=09}
=09/* Add .note::before { content: "Note"; } for autogen label,
=09 or use class=3D"marker" to mark up the label in source. */
=09details.note > summary {
=09=09display: block;
=09=09color: hsl(120, 70%, 30%);
=09}
=09details.note[open] > summary {
=09=09border-bottom: 1px silver solid;
=09}
/** Assertion Box *********************************************************=
****/
=09/* for assertions in algorithms */
=09.assertion {
=09=09border-color: #AAA;
=09=09background: #EEE;
=09}
/** Advisement Box ********************************************************=
****/
=09/* for attention-grabbing normative statements */
=09.advisement {
=09=09border-color: orange;
=09=09border-style: none solid;
=09=09background: #FFEECC;
=09}
=09strong.advisement {
=09=09display: block;
=09=09text-align: center;
=09}
=09.advisement > .marker {
=09=09color: #B35F00;
=09}
/** Spec Obsoletion Notice ************************************************=
****/
=09/* obnoxious obsoletion notice for older/abandoned specs. */
=09details {
=09=09display: block;
=09}
=09summary {
=09=09font-weight: bolder;
=09}
=09.annoying-warning:not(details),
=09details.annoying-warning:not([open]) > summary,
=09details.annoying-warning[open] {
=09=09background: #fdd;
=09=09color: red;
=09=09font-weight: bold;
=09=09padding: .75em 1em;
=09=09border: thick red;
=09=09border-style: solid;
=09=09border-radius: 1em;
=09}
=09.annoying-warning :last-child {
=09=09margin-bottom: 0;
=09}
@media not print {
=09details.annoying-warning[open] {
=09=09position: fixed;
=09=09left: 1em;
=09=09right: 1em;
=09=09bottom: 1em;
=09=09z-index: 1000;
=09}
}
=09details.annoying-warning:not([open]) > summary {
=09=09text-align: center;
=09}
/** Entity Definition Boxes ***********************************************=
****/
=09.def {
=09=09padding: .5em 1em;
=09=09background: #DEF;
=09=09margin: 1.2em 0;
=09=09border-left: 0.5em solid #8CCBF2;
=09}
/**************************************************************************=
****/
/* Tables =
*/
/**************************************************************************=
****/
=09th, td {
=09=09text-align: left;
=09=09text-align: start;
=09}
/** Property/Descriptor Definition Tables *********************************=
****/
=09table.def {
=09=09/* inherits .def box styling, see above */
=09=09width: 100%;
=09=09border-spacing: 0;
=09}
=09table.def td,
=09table.def th {
=09=09padding: 0.5em;
=09=09vertical-align: baseline;
=09=09border-bottom: 1px solid #bbd7e9;
=09}
=09table.def > tbody > tr:last-child th,
=09table.def > tbody > tr:last-child td {
=09=09border-bottom: 0;
=09}
=09table.def th {
=09=09font-style: italic;
=09=09font-weight: normal;
=09=09padding-left: 1em;
=09=09width: 3em;
=09}
=09/* For when values are extra-complex and need formatting for readability=
*/
=09table td.pre {
=09=09white-space: pre-wrap;
=09}
=09/* A footnote at the bottom of a def table */
=09table.def td.footnote {
=09=09padding-top: 0.6em;
=09}
=09table.def td.footnote::before {
=09=09content: " ";
=09=09display: block;
=09=09height: 0.6em;
=09=09width: 4em;
=09=09border-top: thin solid;
=09}
/** Data tables (and properly marked-up index tables) *********************=
****/
=09/*
=09=09 <table class=3D"data"> highlights structural relationships in a tabl=
e
=09=09 when correct markup is used (e.g. thead/tbody, th vs. td, scope attr=
ibute)
=09=09 Use class=3D"complex data" for particularly complicated tables --
=09=09 (This will draw more lines: busier, but clearer.)
=09=09 Use class=3D"long" on table cells with paragraph-like contents
=09=09 (This will adjust text alignment accordingly.)
=09=09 Alternately use class=3D"longlastcol" on tables, to have the last co=
lumn assume "long".
=09*/
=09table {
=09=09word-wrap: normal;
=09=09overflow-wrap: normal;
=09=09hyphens: manual;
=09}
=09table.data,
=09table.index {
=09=09margin: 1em auto;
=09=09border-collapse: collapse;
=09=09border: hidden;
=09=09width: 100%;
=09}
=09table.data caption,
=09table.index caption {
=09=09max-width: 50em;
=09=09margin: 0 auto 1em;
=09}
=09table.data td, table.data th,
=09table.index td, table.index th {
=09=09padding: 0.5em 1em;
=09=09border-width: 1px;
=09=09border-color: silver;
=09=09border-top-style: solid;
=09}
=09table.data thead td:empty {
=09=09padding: 0;
=09=09border: 0;
=09}
=09table.data thead,
=09table.index thead,
=09table.data tbody,
=09table.index tbody {
=09=09border-bottom: 2px solid;
=09}
=09table.data colgroup,
=09table.index colgroup {
=09=09border-left: 2px solid;
=09}
=09table.data tbody th:first-child,
=09table.index tbody th:first-child {
=09=09border-right: 2px solid;
=09=09border-top: 1px solid silver;
=09=09padding-right: 1em;
=09}
=09table.data th[colspan],
=09table.data td[colspan] {
=09=09text-align: center;
=09}
=09table.complex.data th,
=09table.complex.data td {
=09=09border: 1px solid silver;
=09=09text-align: center;
=09}
=09table.data.longlastcol td:last-child,
=09table.data td.long {
=09 vertical-align: baseline;
=09 text-align: left;
=09}
=09table.data img {
=09=09vertical-align: middle;
=09}
/*
Alternate table alignment rules
=09table.data,
=09table.index {
=09=09text-align: center;
=09}
=09table.data thead th[scope=3D"row"],
=09table.index thead th[scope=3D"row"] {
=09=09text-align: right;
=09}
=09table.data tbody th:first-child,
=09table.index tbody th:first-child {
=09=09text-align: right;
=09}
Possible extra rowspan handling
=09table.data tbody th[rowspan]:not([rowspan=3D'1']),
=09table.index tbody th[rowspan]:not([rowspan=3D'1']),
=09table.data tbody td[rowspan]:not([rowspan=3D'1']),
=09table.index tbody td[rowspan]:not([rowspan=3D'1']) {
=09=09border-left: 1px solid silver;
=09}
=09table.data tbody th[rowspan]:first-child,
=09table.index tbody th[rowspan]:first-child,
=09table.data tbody td[rowspan]:first-child,
=09table.index tbody td[rowspan]:first-child{
=09=09border-left: 0;
=09=09border-right: 1px solid silver;
=09}
*/
/**************************************************************************=
****/
/* Indices =
*/
/**************************************************************************=
****/
/** Table of Contents *****************************************************=
****/
=09.toc a {
=09=09/* More spacing; use padding to make it part of the click target. */
=09=09padding-top: 0.1rem;
=09=09/* Larger, more consistently-sized click target */
=09=09display: block;
=09=09/* Reverse color scheme */
=09=09color: black;
=09=09border-color: #3980B5;
=09=09border-bottom-width: 3px !important;
=09=09margin-bottom: 0px !important;
=09}
=09.toc a:visited {
=09=09border-color: #054572;
=09}
=09.toc a:not(:focus):not(:hover) {
=09=09/* Allow colors to cascade through from link styling */
=09=09border-bottom-color: transparent;
=09}
=09.toc, .toc ol, .toc ul, .toc li {
=09=09list-style: none; /* Numbers must be inlined into source */
=09=09/* because generated content isn't search/selectable and markers can'=
t do multilevel yet */
=09=09margin: 0;
=09=09padding: 0;
=09=09line-height: 1.1rem; /* consistent spacing */
=09}
=09/* ToC not indented until third level, but font style & margins show hie=
rarchy */
=09.toc > li { font-weight: bold; }
=09.toc > li li { font-weight: normal; }
=09.toc > li li li { font-size: 95%; }
=09.toc > li li li li { font-size: 90%; }
=09.toc > li li li li li { font-size: 85%; }
=09.toc > li { margin: 1.5rem 0; }
=09.toc > li li { margin: 0.3rem 0; }
=09.toc > li li li { margin-left: 2rem; }
=09/* Section numbers in a column of their own */
=09.toc .secno {
=09=09float: left;
=09=09width: 4rem;
=09=09white-space: nowrap;
=09}
=09.toc > li li li li .secno {
=09=09font-size: 85%;
=09}
=09.toc > li li li li li .secno {
=09=09font-size: 100%;
=09}
=09:not(li) > .toc { margin-left: 5rem; }
=09.toc .secno { margin-left: -5rem; }
=09.toc > li li li .secno { margin-left: -7rem; }
=09.toc > li li li li .secno { margin-left: -9rem; }
=09.toc > li li li li li .secno { margin-left: -11rem; }
=09/* Tighten up indentation in narrow ToCs */
=09@media (max-width: 30em) {
=09=09:not(li) > .toc { margin-left: 4rem; }
=09=09.toc .secno { margin-left: -4rem; }
=09=09.toc > li li li { margin-left: 1rem; }
=09=09.toc > li li li .secno { margin-left: -5rem; }
=09=09.toc > li li li li .secno { margin-left: -6rem; }
=09=09.toc > li li li li li .secno { margin-left: -7rem; }
=09}
=09@media screen and (min-width: 78em) {
=09=09body:not(.toc-inline) :not(li) > .toc { margin-left: 4r=
em; }
=09=09body:not(.toc-inline) .toc .secno { margin-left: -4r=
em; }
=09=09body:not(.toc-inline) .toc > li li li { margin-left: 1r=
em; }
=09=09body:not(.toc-inline) .toc > li li li .secno { margin-left: -5r=
em; }
=09=09body:not(.toc-inline) .toc > li li li li .secno { margin-left: -6r=
em; }
=09=09body:not(.toc-inline) .toc > li li li li li .secno { margin-left: -7r=
em; }
=09}
=09body.toc-sidebar #toc :not(li) > .toc { margin-left: 4rem;=
}
=09body.toc-sidebar #toc .toc .secno { margin-left: -4rem;=
}
=09body.toc-sidebar #toc .toc > li li li { margin-left: 1rem;=
}
=09body.toc-sidebar #toc .toc > li li li .secno { margin-left: -5rem;=
}
=09body.toc-sidebar #toc .toc > li li li li .secno { margin-left: -6rem;=
}
=09body.toc-sidebar #toc .toc > li li li li li .secno { margin-left: -7rem;=
}
=09.toc li {
=09=09clear: both;
=09}
/** Index *****************************************************************=
****/
=09/* Index Lists: Layout */
=09ul.index { margin-left: 0; columns: 15em; text-indent: 1em hanging=
; }
=09ul.index li { margin-left: 0; list-style: none; break-inside: avoid; =
}
=09ul.index li li { margin-left: 1em }
=09ul.index dl { margin-top: 0; }
=09ul.index dt { margin: .2em 0 .2em 20px;}
=09ul.index dd { margin: .2em 0 .2em 40px;}
=09/* Index Lists: Typography */
=09ul.index ul,
=09ul.index dl { font-size: smaller; }
=09@media not print {
=09=09ul.index li span {
=09=09=09white-space: nowrap;
=09=09=09color: transparent; }
=09=09ul.index li a:hover + span,
=09=09ul.index li a:focus + span {
=09=09=09color: #707070;
=09=09}
=09}
/** Index Tables *****************************************************/
=09/* See also the data table styling section, which this effectively subcl=
asses */
=09table.index {
=09=09font-size: small;
=09=09border-collapse: collapse;
=09=09border-spacing: 0;
=09=09text-align: left;
=09=09margin: 1em 0;
=09}
=09table.index td,
=09table.index th {
=09=09padding: 0.4em;
=09}
=09table.index tr:hover td:not([rowspan]),
=09table.index tr:hover th:not([rowspan]) {
=09=09background: #f7f8f9;
=09}
=09/* The link in the first column in the property table (formerly a TD) */
=09table.index th:first-child a {
=09=09font-weight: bold;
=09}
/**************************************************************************=
****/
/* Print =
*/
/**************************************************************************=
****/
=09@media print {
=09=09/* Pages have their own margins. */
=09=09html {
=09=09=09margin: 0;
=09=09}
=09=09/* Serif for print. */
=09=09body {
=09=09=09font-family: serif;
=09=09}
=09}
=09@page {
=09=09margin: 1.5cm 1.1cm;
=09}
/**************************************************************************=
****/
/* Legacy =
*/
/**************************************************************************=
****/
=09/* This rule is inherited from past style sheets. No idea what it's for.=
*/
=09.hide { display: none }
/**************************************************************************=
****/
/* Overflow Control =
*/
/**************************************************************************=
****/
=09.figure .caption, .sidefigure .caption, figcaption {
=09=09/* in case figure is overlarge, limit caption to 50em */
=09=09max-width: 50rem;
=09=09margin-left: auto;
=09=09margin-right: auto;
=09}
=09.overlarge > table {
=09=09/* limit preferred width of table */
=09=09max-width: 50em;
=09=09margin-left: auto;
=09=09margin-right: auto;
=09}
=09@media (min-width: 55em) {
=09=09.overlarge {
=09=09=09margin-left: calc(13px + 26.5rem - 50vw);
=09=09=09margin-right: calc(13px + 26.5rem - 50vw);
=09=09=09max-width: none;
=09=09}
=09}
=09@media screen and (min-width: 78em) {
=09=09body:not(.toc-inline) .overlarge {
=09=09=09/* 30.5em body padding 50em content area */
=09=09=09margin-left: calc(40em - 50vw) !important;
=09=09=09margin-right: calc(40em - 50vw) !important;
=09=09}
=09}
=09@media screen and (min-width: 90em) {
=09=09body:not(.toc-inline) .overlarge {
=09=09=09/* 4em html margin 30.5em body padding 50em content area */
=09=09=09margin-left: 0 !important;
=09=09=09margin-right: calc(84.5em - 100vw) !important;
=09=09}
=09}
=09@media not print {
=09=09.overlarge {
=09=09=09overflow-x: auto;
=09=09=09/* See Lea Verou's explanation background-attachment:
=09=09=09 * http://lea.verou.me/2012/04/background-attachment-local/
=09=09=09 *
=09=09=09background: top left / 4em 100% linear-gradient(to right, #fffff=
f, rgba(255, 255, 255, 0)) local,
=09=09=09 top right / 4em 100% linear-gradient(to left, #ffffff,=
rgba(255, 255, 255, 0)) local,
=09=09=09 top left / 1em 100% linear-gradient(to right, #c3c3c=
5, rgba(195, 195, 197, 0)) scroll,
=09=09=09 top right / 1em 100% linear-gradient(to left, #c3c3c5,=
rgba(195, 195, 197, 0)) scroll,
=09=09=09 white;
=09=09=09background-repeat: no-repeat;
=09=09=09*/
=09=09}
=09}
</style>
<meta content=3D"Bikeshed version 4d971631feeeaab3c7ed89882ecd376a796b379=
4" name=3D"generator">
<link href=3D"https://github.com/TBBle/WG21-void/blob/master/papers/dxxxx=
r0.bs" rel=3D"canonical">
<style>/* style-md-lists */
/* This is a weird hack for me not yet following the commonmark=
spec
regarding paragraph and lists. */
[data-md] > :first-child {
margin-top: 0;
}
[data-md] > :last-child {
margin-bottom: 0;
}</style>
<style>/* style-counters */
body {
counter-reset: example figure issue;
}
.issue {
counter-increment: issue;
}
.issue:not(.no-marker)::before {
content: "Issue " counter(issue);
}
.example {
counter-increment: example;
}
.example:not(.no-marker)::before {
content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
content: "Invalid Example" counter(example);
}
figcaption {
counter-increment: figure;
}
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}</style>
<style>/* style-syntax-highlighting */
.highlight:not(.idl) { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em;=
margin: .5em 0; overflow: auto; border-radius: 0; }
.highlight .c { color: #708090 } /* Comment */
.highlight .k { color: #990055 } /* Keyword */
.highlight .l { color: #000000 } /* Literal */
.highlight .n { color: #0077aa } /* Name */
.highlight .o { color: #999999 } /* Operator */
.highlight .p { color: #999999 } /* Punctuation */
.highlight .cm { color: #708090 } /* Comment.Multiline */
.highlight .cp { color: #708090 } /* Comment.Preproc */
.highlight .c1 { color: #708090 } /* Comment.Single */
.highlight .cs { color: #708090 } /* Comment.Special */
.highlight .kc { color: #990055 } /* Keyword.Constant */
.highlight .kd { color: #990055 } /* Keyword.Declaration */
.highlight .kn { color: #990055 } /* Keyword.Namespace */
.highlight .kp { color: #990055 } /* Keyword.Pseudo */
.highlight .kr { color: #990055 } /* Keyword.Reserved */
.highlight .kt { color: #990055 } /* Keyword.Type */
.highlight .ld { color: #000000 } /* Literal.Date */
.highlight .m { color: #000000 } /* Literal.Number */
.highlight .s { color: #a67f59 } /* Literal.String */
.highlight .na { color: #0077aa } /* Name.Attribute */
.highlight .nc { color: #0077aa } /* Name.Class */
.highlight .no { color: #0077aa } /* Name.Constant */
.highlight .nd { color: #0077aa } /* Name.Decorator */
.highlight .ni { color: #0077aa } /* Name.Entity */
.highlight .ne { color: #0077aa } /* Name.Exception */
.highlight .nf { color: #0077aa } /* Name.Function */
.highlight .nl { color: #0077aa } /* Name.Label */
.highlight .nn { color: #0077aa } /* Name.Namespace */
.highlight .py { color: #0077aa } /* Name.Property */
.highlight .nt { color: #669900 } /* Name.Tag */
.highlight .nv { color: #222222 } /* Name.Variable */
.highlight .ow { color: #999999 } /* Operator.Word */
.highlight .mb { color: #000000 } /* Literal.Number.Bin */
.highlight .mf { color: #000000 } /* Literal.Number.Float */
.highlight .mh { color: #000000 } /* Literal.Number.Hex */
.highlight .mi { color: #000000 } /* Literal.Number.Integer */
.highlight .mo { color: #000000 } /* Literal.Number.Oct */
.highlight .sb { color: #a67f59 } /* Literal.String.Backtick */
.highlight .sc { color: #a67f59 } /* Literal.String.Char */
.highlight .sd { color: #a67f59 } /* Literal.String.Doc */
.highlight .s2 { color: #a67f59 } /* Literal.String.Double */
.highlight .se { color: #a67f59 } /* Literal.String.Escape */
.highlight .sh { color: #a67f59 } /* Literal.String.Heredoc */
.highlight .si { color: #a67f59 } /* Literal.String.Interpol */
.highlight .sx { color: #a67f59 } /* Literal.String.Other */
.highlight .sr { color: #a67f59 } /* Literal.String.Regex */
.highlight .s1 { color: #a67f59 } /* Literal.String.Single */
.highlight .ss { color: #a67f59 } /* Literal.String.Symbol */
.highlight .vc { color: #0077aa } /* Name.Variable.Class */
.highlight .vg { color: #0077aa } /* Name.Variable.Global */
.highlight .vi { color: #0077aa } /* Name.Variable.Instance */
.highlight .il { color: #000000 } /* Literal.Number.Integer.Long */
</style>
<style>/* style-selflinks */
.heading, .issue, .note, .example, li, dt {
position: relative;
}
a.self-link {
position: absolute;
top: 0;
left: calc(-1 * (3.5rem - 26px));
width: calc(3.5rem - 26px);
height: 2em;
text-align: center;
border: none;
transition: opacity .2s;
opacity: .5;
}
a.self-link:hover {
opacity: 1;
}
.heading > a.self-link {
font-size: 83%;
}
li > a.self-link {
left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
top: auto;
left: auto;
opacity: 0;
width: 1.5em;
height: 1.5em;
background: gray;
color: white;
font-style: normal;
transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
opacity: 1;
}
dfn > a.self-link:hover {
color: black;
}
a.self-link::before { content: "=C2=B6"; }
.heading > a.self-link::before { content: "=C2=A7"; }
dfn > a.self-link::before { content: "#"; }</style>
<style>/* style-autolinks */
.css.css, .property.property, .descriptor.descriptor {
color: #005a9c;
font-size: inherit;
font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
content: "=E2=80=98";
}
.css::after, .property::after, .descriptor::after {
content: "=E2=80=99";
}
.property, .descriptor {
/* Don't wrap property and descriptor names */
white-space: nowrap;
}
.type { /* CSS value <type> */
font-style: italic;
}
pre .property::before, pre .property::after {
content: "";
}
[data-link-type=3D"property"]::before,
[data-link-type=3D"propdesc"]::before,
[data-link-type=3D"descriptor"]::before,
[data-link-type=3D"value"]::before,
[data-link-type=3D"function"]::before,
[data-link-type=3D"at-rule"]::before,
[data-link-type=3D"selector"]::before,
[data-link-type=3D"maybe"]::before {
content: "=E2=80=98";
}
[data-link-type=3D"property"]::after,
[data-link-type=3D"propdesc"]::after,
[data-link-type=3D"descriptor"]::after,
[data-link-type=3D"value"]::after,
[data-link-type=3D"function"]::after,
[data-link-type=3D"at-rule"]::after,
[data-link-type=3D"selector"]::after,
[data-link-type=3D"maybe"]::after {
content: "=E2=80=99";
}
[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
content: "";
}
[data-link-type=3Delement],
[data-link-type=3Delement-attr] {
font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace=
;
font-size: .9em;
}
[data-link-type=3Delement]::before { content: "<" }
[data-link-type=3Delement]::after { content: ">" }
[data-link-type=3Dbiblio] {
white-space: pre;
}</style>
<link rel=3D"stylesheet" type=3D"text/css" href=3D"chrome-extension://pkeh=
gijcmpdhfbdbbnkijodmdjhbjlgp/skin/socialwidgets.css"></head><body class=3D"=
h-entry toc-sidebar"><p id=3D"toc-nav"><a id=3D"toc-jump" href=3D"https://t=
bble.github.io/WG21-void/dxxxxr0.html#toc"><span aria-hidden=3D"true">=E2=
=86=91</span> <span>Jump to Table of Contents</span></a><a id=3D"toc-toggle=
" href=3D"https://tbble.github.io/WG21-void/dxxxxr0.html#toc"><span aria-hi=
dden=3D"true">=E2=86=90</span> <span>Collapse Sidebar</span></a></p>
<div class=3D"head">
<p data-fill-with=3D"logo"></p>
<h1 class=3D"p-name no-ref" id=3D"title">dxxxxr0d0<br>Unambiguous prvalu=
e <code class=3D"highlight"><span class=3D"kt">void</span></code></h1>
<h2 class=3D"no-num no-toc no-ref heading settled" id=3D"subtitle"><span=
class=3D"content">Draft Proposal, <time class=3D"dt-updated" datetime=3D"2=
017-05-14">14 May 2017</time></span></h2>
<div data-fill-with=3D"spec-metadata">
<dl>
<dt>This version:
</dt><dd><a class=3D"u-url" href=3D"https://github.com/TBBle/WG21-void=
/blob/master/papers/dxxxxr0.bs">https://github.com/TBBle/WG21-void/blob/mas=
ter/papers/dxxxxr0.bs</a>
</dd><dt>Author:
</dt><dd>
</dd><dd class=3D"editor p-author h-card vcard"><span class=3D"p-name=
fn">Paul "TBBle" Hampson <Paul.Hampson@Pobox.com></span>
</dd><dt>Audience:
</dt><dd>EWG
</dd><dt>Project:
</dt><dd><span>ISO JTC1/SC22/WG21: Programming Language C++</span>
</dd></dl>
</div>
<div data-fill-with=3D"warning"></div>
<hr title=3D"Separator for header">
</div>
<div class=3D"p-summary" data-fill-with=3D"abstract">
<h2 class=3D"no-num no-toc no-ref heading settled" id=3D"abstract"><span=
class=3D"content">Abstract</span></h2>
<p><code class=3D"highlight"><span class=3D"kt">void</span><span class=
=3D"p">(</span><span class=3D"p">)</span></code> is comparable to any <code=
class=3D"highlight"><span class=3D"n">type</span><span class=3D"p">(</span=
><span class=3D"p">)</span></code>, but <code class=3D"highlight"><span cla=
ss=3D"kt">void</span><span class=3D"p">{</span><span class=3D"p">}</span></=
code> is needlessly invalid.</p>
</div>
<nav data-fill-with=3D"table-of-contents" id=3D"toc">
<h2 class=3D"no-num no-toc no-ref" id=3D"contents">Table of Contents</h2=
>
<ol class=3D"toc" role=3D"directory">
<li><a href=3D"https://tbble.github.io/WG21-void/dxxxxr0.html#proposal"=
><span class=3D"secno">1</span> <span class=3D"content">Proposal</span></a>
</li><li><a href=3D"https://tbble.github.io/WG21-void/dxxxxr0.html#rela=
ted"><span class=3D"secno">2</span> <span class=3D"content">Related Work</s=
pan></a>
</li><li><a href=3D"https://tbble.github.io/WG21-void/dxxxxr0.html#moti=
vation"><span class=3D"secno">3</span> <span class=3D"content">Motivation</=
span></a>
</li><li><a href=3D"https://tbble.github.io/WG21-void/dxxxxr0.html#word=
ing"><span class=3D"secno">4</span> <span class=3D"content">Wording</span><=
/a>
</li><li>
<a href=3D"https://tbble.github.io/WG21-void/dxxxxr0.html#references">=
<span class=3D"secno"></span> <span class=3D"content">References</span></a>
<ol class=3D"toc">
<li><a href=3D"https://tbble.github.io/WG21-void/dxxxxr0.html#normati=
ve"><span class=3D"secno"></span> <span class=3D"content">Normative Referen=
ces</span></a>
</li><li><a href=3D"https://tbble.github.io/WG21-void/dxxxxr0.html#in=
formative"><span class=3D"secno"></span> <span class=3D"content">Informativ=
e References</span></a>
</li></ol>
</li></ol>
</nav>
<main>
<h2 class=3D"heading settled" data-level=3D"1" id=3D"proposal"><span cla=
ss=3D"secno">1. </span><span class=3D"content">Proposal</span><a class=3D"s=
elf-link" href=3D"https://tbble.github.io/WG21-void/dxxxxr0.html#proposal">=
</a></h2>
<p>An explicit prvalue of type <code class=3D"highlight"><span class=3D"=
kt">void</span></code> (spelled <code class=3D"highlight"><span class=3D"kt=
">void</span><span class=3D"p">(</span><span class=3D"p">)</span></code> or=
"type_equivalent to <code class=3D"highlight"><span class=3D"kt">void</spa=
n></code>"<code class=3D"highlight"><span class=3D"p">(</span><span class=
=3D"p">)</span></code>) has a very restricted range of use-cases, per <a hr=
ef=3D"http://eel.is/c++draft/basic.types#basic.fundamental-9"><b>[basic.fun=
damental]</b>/9</a>.</p>
<p>As with all expressions <code class=3D"highlight"><span class=3D"n">T=
</span><span class=3D"p">(</span><span class=3D"p">)</span></code>, the 'Mo=
st Vexing Parse' results in <code class=3D"highlight"><span class=3D"kt">vo=
id</span><span class=3D"p">(</span><span class=3D"p">)</span></code> being =
parsed as a declaration of a parameterless function returning void, unless =
in a context where only an expression is possible.</p>
<p>The only use-case for an expression of type <code class=3D"highlight"=
><span class=3D"kt">void</span></code> which are not already in expression =
context is <code class=3D"highlight"><span class=3D"k">typeid</span></code>=
.. In this case, <code class=3D"highlight"><span class=3D"k">typeid</span><s=
pan class=3D"p">(</span><span class=3D"kt">void</span><span class=3D"p">(</=
span><span class=3D"p">)</span><span class=3D"p">)</span></code> is not equ=
ivalent to <code class=3D"highlight"><span class=3D"k">typeid</span><span c=
lass=3D"p">(</span><span class=3D"kt">void</span><span class=3D"p">)</span>=
</code>. This is true of all other types, of course.</p>
<p><code class=3D"highlight"><span class=3D"k">sizeof</span><span class=
=3D"p">(</span><span class=3D"kt">void</span><span class=3D"p">(</span><spa=
n class=3D"p">)</span><span class=3D"p">)</span></code> will also see a fun=
ction declaration, not an expression of type <code class=3D"highlight"><spa=
n class=3D"kt">void</span></code>, but since both are invalid operands for =
<code class=3D"highlight"><span class=3D"k">sizeof</span></code>, the disti=
nction is merely in the compiler diagnostic reported.</p>
<p>The usual method to disambiguate such parses is to write <code class=
=3D"highlight"><span class=3D"n">T</span><span class=3D"p">{</span><span cl=
ass=3D"p">}</span></code> instead. Since <a data-link-type=3D"biblio" href=
=3D"https://tbble.github.io/WG21-void/dxxxxr0.html#biblio-p0135r1">[p0135r1=
]</a>, this is explicitly disallowed by the standard: The literal spelling =
<code class=3D"highlight"><span class=3D"kt">void</span><span class=3D"p">(=
</span><span class=3D"p">)</span></code> or the generic spelling <code clas=
s=3D"highlight"><span class=3D"n">T</span><span class=3D"p">(</span><span c=
lass=3D"p">)</span></code> where <code class=3D"highlight"><span class=3D"n=
">T</span></code> somehow evaluates to <code class=3D"highlight"><span clas=
s=3D"kt">void</span></code> is explicitly called out in <a href=3D"http://e=
el.is/c++draft/expr.type.conv#2"><b>[expr.type.conv]</b>/2</a> as "a prvalu=
e of the specified type that performs no initialization". The equivalent sp=
elling using <code class=3D"highlight"><span class=3D"p">{</span><span clas=
s=3D"p">}</span></code> continues through the "otherwise" rules to direct-i=
nitialise a result object, failing when a requirement is hit to zero-initia=
lise a prvalue of <code class=3D"highlight"><span class=3D"kt">void</span><=
/code>, which is not possible, as <a href=3D"http://eel.is/c++draft/dcl.ini=
t#6">zero-initialisation</a> is only defined for scalars, class types, arra=
y types or reference types.</p>
<p>While that seems like a relatively minor use-case, it becomes more in=
teresting when using a type expression then evaluates to <code class=3D"hig=
hlight"><span class=3D"kt">void</span></code>. Authors of generic code shou=
ld prefer (<a data-link-type=3D"biblio" href=3D"https://tbble.github.io/WG2=
1-void/dxxxxr0.html#biblio-ccg">[C++CG]</a>) to use unambigous <code class=
=3D"highlight"><span class=3D"n">T</span><span class=3D"p">{</span><span cl=
ass=3D"p">}</span></code> to get a prvalue of type <code class=3D"highlight=
"><span class=3D"n">T</span></code>, and should not be stymied when that mi=
ght happen to be <code class=3D"highlight"><span class=3D"kt">void</span></=
code>.</p>
<p>So I propose that <code class=3D"highlight"><span class=3D"kt">void</=
span><span class=3D"p">{</span><span class=3D"p">}</span></code> (and gener=
ic spellings thereof) be treated identically to <code class=3D"highlight"><=
span class=3D"kt">void</span><span class=3D"p">(</span><span class=3D"p">)<=
/span></code> and generic spellings thereof, to close this gap.</p>
<p>The standard should also make use of <code class=3D"highlight"><span =
class=3D"kt">void</span><span class=3D"p">{</span><span class=3D"p">}</span=
></code> rather than <code class=3D"highlight"><span class=3D"kt">void</spa=
n><span class=3D"p">(</span><span class=3D"p">)</span></code> in the few pl=
aces it explicitly spells out the expression, leaving <code class=3D"highli=
ght"><span class=3D"kt">void</span><span class=3D"p">(</span><span class=3D=
"p">)</span></code> to be used only when a declaration of a parameterless f=
unction returning <code class=3D"highlight"><span class=3D"kt">void</span><=
/code> is intended.</p>
<h2 class=3D"heading settled" data-level=3D"2" id=3D"related"><span clas=
s=3D"secno">2. </span><span class=3D"content">Related Work</span><a class=
=3D"self-link" href=3D"https://tbble.github.io/WG21-void/dxxxxr0.html#relat=
ed"></a></h2>
<p>There is already a larger proposal in flight, <a data-link-type=3D"bi=
blio" href=3D"https://tbble.github.io/WG21-void/dxxxxr0.html#biblio-p0146r1=
">[p0146r1]</a>, which would remove this special-case entirely. This curren=
t proposal would be obsolete if that proposal is accepted, and in the meant=
ime represents a smaller, simpler change in the same direction.</p>
<h2 class=3D"heading settled" data-level=3D"3" id=3D"motivation"><span c=
lass=3D"secno">3. </span><span class=3D"content">Motivation</span><a class=
=3D"self-link" href=3D"https://tbble.github.io/WG21-void/dxxxxr0.html#motiv=
ation"></a></h2>
<p>The frame of a <a href=3D"https://wandbox.org/permlink/6IEUOp05sg6orI=
OR">motiviating case</a> is:</p>
<pre class=3D"language-cpp highlight"><span class=3D"cp">#</span><span clas=
s=3D"cp">include</span> <iostream><span class=3D"cp">
</span><span class=3D"cp">#</span><span class=3D"cp">include</span> <typ=
e_traits><span class=3D"cp">
</span><span class=3D"cp">#</span><span class=3D"cp">include</span> <cas=
sert><span class=3D"cp">
</span>
<span class=3D"k">template</span> <span class=3D"o"><</span><span class=
=3D"kt">bool</span> <span class=3D"n">skip</span><span class=3D"p">,</span>=
<span class=3D"k">typename</span> <span class=3D"n">Func</span><span class=
=3D"p">,</span> <span class=3D"k">typename</span><span class=3D"p">.</span>=
<span class=3D"p">.</span><span class=3D"p">.</span> <span class=3D"n">Args=
</span><span class=3D"p">,</span>
<span class=3D"k">typename</span> <span class=3D"n">Return</span> <span c=
lass=3D"o">=3D</span> <span class=3D"n">std</span><span class=3D"o">:</span=
><span class=3D"o">:</span><span class=3D"n">result_of_t</span><span class=
=3D"o"><</span><span class=3D"n">Func</span><span class=3D"p">(</span><s=
pan class=3D"n">Args</span><span class=3D"p">.</span><span class=3D"p">.</s=
pan><span class=3D"p">.</span><span class=3D"p">)</span><span class=3D"o">&=
gt;</span><span class=3D"o">></span>
<span class=3D"n">Return</span> <span class=3D"n">maybe_skip</span><span cl=
ass=3D"p">(</span><span class=3D"n">Func</span><span class=3D"o">&</spa=
n><span class=3D"o">&</span> <span class=3D"n">func</span><span class=
=3D"p">,</span> <span class=3D"n">Args</span><span class=3D"o">&</span>=
<span class=3D"o">&</span><span class=3D"p">.</span><span class=3D"p">.=
</span><span class=3D"p">.</span> <span class=3D"n">args</span><span class=
=3D"p">)</span>
<span class=3D"p">{</span>
<span class=3D"k">if</span> <span class=3D"k">constexpr</span> <span clas=
s=3D"p">(</span><span class=3D"n">skip</span><span class=3D"p">)</span> <sp=
an class=3D"p">{</span> <span class=3D"c1">// <=3D=3D #1
</span> <span class=3D"k">return</span> <span class=3D"n">Return</span><=
span class=3D"p">{</span><span class=3D"p">}</span><span class=3D"p">;</spa=
n> <span class=3D"c1">// <=3D=3D #2
</span> <span class=3D"p">}</span> <span class=3D"k">else</span> <span cla=
ss=3D"p">{</span>
<span class=3D"k">return</span> <span class=3D"n">std</span><span class=
=3D"o">:</span><span class=3D"o">:</span><span class=3D"n">forward</span><s=
pan class=3D"o"><</span><span class=3D"n">Func</span><span class=3D"o">&=
amp;</span><span class=3D"o">&</span><span class=3D"o">></span><span=
class=3D"p">(</span><span class=3D"n">func</span><span class=3D"p">)</span=
><span class=3D"p">(</span><span class=3D"n">std</span><span class=3D"o">:<=
/span><span class=3D"o">:</span><span class=3D"n">forward</span><span class=
=3D"o"><</span><span class=3D"n">Args</span><span class=3D"o">&</spa=
n><span class=3D"o">&</span><span class=3D"o">></span><span class=3D=
"p">(</span><span class=3D"n">args</span><span class=3D"p">)</span><span cl=
ass=3D"p">.</span><span class=3D"p">.</span><span class=3D"p">.</span><span=
class=3D"p">)</span><span class=3D"p">;</span>
<span class=3D"p">}</span>
<span class=3D"p">}</span>
<span class=3D"kt">int</span> <span class=3D"n">calculate</span><span class=
=3D"p">(</span><span class=3D"kt">int</span> <span class=3D"n">a</span><spa=
n class=3D"p">,</span> <span class=3D"kt">int</span> <span class=3D"n">b</s=
pan><span class=3D"p">,</span> <span class=3D"kt">int</span> <span class=3D=
"n">c</span><span class=3D"p">)</span>
<span class=3D"p">{</span>
<span class=3D"k">return</span> <span class=3D"n">a</span> <span class=3D=
"o">+</span> <span class=3D"n">b</span> <span class=3D"o">*</span> <span cl=
ass=3D"n">c</span><span class=3D"p">;</span>
<span class=3D"p">}</span>
<span class=3D"kt">void</span> <span class=3D"n">output</span><span class=
=3D"p">(</span><span class=3D"kt">int</span> <span class=3D"n">value</span>=
<span class=3D"p">)</span>
<span class=3D"p">{</span>
<span class=3D"n">std</span><span class=3D"o">:</span><span class=3D"o">:=
</span><span class=3D"n">cout</span> <span class=3D"o"><</span><span cla=
ss=3D"o"><</span> <span class=3D"n">value</span> <span class=3D"o"><<=
/span><span class=3D"o"><</span> <span class=3D"s">"</span><span class=
=3D"se">\n</span><span class=3D"s">"</span><span class=3D"p">;</span>
<span class=3D"p">}</span>
<span class=3D"kt">int</span> <span class=3D"n">main</span><span class=3D"p=
">(</span><span class=3D"p">)</span>
<span class=3D"p">{</span>
<span class=3D"c1">// Easy.
</span> <span class=3D"kt">int</span> <span class=3D"n">result</span> <spa=
n class=3D"o">=3D</span> <span class=3D"n">maybe_skip</span><span class=3D"=
o"><</span>false<span class=3D"o">></span><span class=3D"p">(</span><=
span class=3D"n">calculate</span><span class=3D"p">,</span> <span class=3D"=
mi">5</span><span class=3D"p">,</span> <span class=3D"mi">6</span><span cla=
ss=3D"p">,</span> <span class=3D"mi">7</span><span class=3D"p">)</span><spa=
n class=3D"p">;</span>
<span class=3D"n">assert</span><span class=3D"p">(</span> <span class=3D"=
n">result</span> <span class=3D"o">=3D</span><span class=3D"o">=3D</span> <=
span class=3D"mi">47</span> <span class=3D"p">)</span><span class=3D"p">;</=
span>
<span class=3D"kt">int</span> <span class=3D"n">noresult</span> <span cla=
ss=3D"o">=3D</span> <span class=3D"n">maybe_skip</span><span class=3D"o">&l=
t;</span>true<span class=3D"o">></span><span class=3D"p">(</span><span c=
lass=3D"n">calculate</span><span class=3D"p">,</span> <span class=3D"mi">5<=
/span><span class=3D"p">,</span> <span class=3D"mi">6</span><span class=3D"=
p">,</span> <span class=3D"mi">7</span><span class=3D"p">)</span><span clas=
s=3D"p">;</span>
<span class=3D"n">assert</span><span class=3D"p">(</span> <span class=3D"=
n">noresult</span> <span class=3D"o">=3D</span><span class=3D"o">=3D</span>=
<span class=3D"mi">0</span> <span class=3D"p">)</span><span class=3D"p">;<=
/span>
<span class=3D"c1">// Fails at #2 without "consexpr" at #1
</span> <span class=3D"n">maybe_skip</span><span class=3D"o"><</span>fa=
lse<span class=3D"o">></span><span class=3D"p">(</span><span class=3D"n"=
>output</span><span class=3D"p">,</span> <span class=3D"n">result</span><sp=
an class=3D"p">)</span><span class=3D"p">;</span>
<span class=3D"c1">// The motivating case, fails at #2 with
</span> <span class=3D"c1">// * "illegal initializer type 'void'" or
</span> <span class=3D"c1">// * "compound literal of non-object type 'void=
'" or
</span> <span class=3D"c1">// * "'initializing': cannot convert from 'init=
ializer list' to 'void'"
</span> <span class=3D"n">maybe_skip</span><span class=3D"o"><</span>tr=
ue<span class=3D"o">></span><span class=3D"p">(</span><span class=3D"n">=
output</span><span class=3D"p">,</span> <span class=3D"n">result</span><spa=
n class=3D"p">)</span><span class=3D"p">;</span>
<span class=3D"p">}</span>
</pre>
<p>Changing <code class=3D"highlight"><span class=3D"k">return</span> <s=
pan class=3D"n">Return</span><span class=3D"p">{</span><span class=3D"p">}<=
/span><span class=3D"p">;</span></code> to <code class=3D"highlight"><span =
class=3D"k">return</span> <span class=3D"nf">Return</span><span class=3D"p"=
>(</span><span class=3D"p">)</span><span class=3D"p">;</span></code> works =
today, but runs counter to advice such as <a href=3D"https://isocpp.github.=
io/CppCoreGuidelines/CppCoreGuidelines#Res-list">"ES.23: Prefer the {} init=
ializer syntax"</a></p>
<h2 class=3D"heading settled" data-level=3D"4" id=3D"wording"><span clas=
s=3D"secno">4. </span><span class=3D"content">Wording</span><a class=3D"sel=
f-link" href=3D"https://tbble.github.io/WG21-void/dxxxxr0.html#wording"></a=
></h2>
Relative to the latest C++ draft, <a data-link-type=3D"biblio" href=3D"=
https://tbble.github.io/WG21-void/dxxxxr0.html#biblio-n4659">[n4659]</a>.=
=20
<p>Change in <b>8.2.3 Explicit type conversion (functional notation) [ex=
pr.type.conv]</b> paragraph 2:</p>
<blockquote>
If the initializer is a parenthesized single expression, the type conve=
rsion expression is equivalent (in definedness, and if defined in meaning) =
to the corresponding cast expression. If the type is cv void and the initia=
lizer is ()
<ins> or {}</ins>
, the expression is a prvalue of the specified type that performs no in=
itialization. Otherwise, the expression is a prvalue of the specified type =
whose result object is direct-initialized with the initializer. For an expr=
ession of the form T(), T shall not be an array type.
</blockquote>
<p>Change in the example at <b>10.1.7.4 The <code class=3D"highlight"><s=
pan class=3D"k">auto</span></code> specificer [dcl.spec.auto]</b> paragraph=
9:</p>
<blockquote> <code class=3D"highlight"><span class=3D"k">auto</span><spa=
n class=3D"o">*</span> <span class=3D"nf">g</span><span class=3D"p">(</span=
><span class=3D"p">)</span> <span class=3D"p">{</span> <span class=3D"p">}<=
/span> <span class=3D"c1">// error, cannot deduce auto* from void</span><de=
l><span class=3D"c1">()</span></del><ins><span class=3D"c1">{}</span></ins>=
</code> </blockquote>
<p>Change in Table 14 of <b>17.5.3 Variadic templates [temp.variadic]</b=
>:</p>
<blockquote>
<table style=3D"border: 1px solid black; border-collapse: collapse;">
<tbody>
<tr style=3D"border-top: 1px solid black;">
<td style=3D"text-align:center; padding-left: 1em; padding-right: 1e=
m;"><b>Operator</b>
</td><td style=3D"text-align:center; padding-left: 1em; padding-righ=
t: 1em;"><b>Value when parameter pack is empty</b>
</td></tr><tr style=3D"border-top: 3px solid black; border-top-style:=
double;">
<td style=3D"text-align:left; padding-left: 1em; padding-right: 1em;=
"><code class=3D"highlight"><span class=3D"o">&</span><span class=3D"o"=
>&</span></code>
</td><td style=3D"text-align:left; padding-left: 1em; padding-right:=
1em;"><code class=3D"highlight">true</code>
</td></tr><tr>
<td style=3D"text-align:left; padding-left: 1em; padding-right: 1em;=
"><code class=3D"highlight"><span class=3D"o">|</span><span class=3D"o">|</=
span></code>
</td><td style=3D"text-align:left; padding-left: 1em; padding-right:=
1em;"><code class=3D"highlight">false</code>
</td></tr><tr>
<td style=3D"text-align:left; padding-left: 1em; padding-right: 1em;=
"><code class=3D"highlight"><span class=3D"p">,</span></code>
</td><td style=3D"text-align:left; padding-left: 1em; padding-right:=
1em;"><code class=3D"highlight"><span class=3D"kt">void</span><del><span c=
lass=3D"p">(</span><span class=3D"p">)</span></del><ins><span class=3D"p">{=
</span><span class=3D"p">}</span></ins></code>
</td></tr></tbody></table>
</blockquote>
</main>
<script>
(function() {
"use strict";
var collapseSidebarText =3D '<span aria-hidden=3D"true">=E2=86=90</span> =
'
+ '<span>Collapse Sidebar</span>';
var expandSidebarText =3D '<span aria-hidden=3D"true">=E2=86=92</span> =
'
+ '<span>Pop Out Sidebar</span>';
var tocJumpText =3D '<span aria-hidden=3D"true">=E2=86=91</span> =
'
+ '<span>Jump to Table of Contents</span>';
var sidebarMedia =3D window.matchMedia('screen and (min-width: 78em)');
var autoToggle =3D function(e){ toggleSidebar(e.matches) };
if(sidebarMedia.addListener) {
sidebarMedia.addListener(autoToggle);
}
function toggleSidebar(on) {
if (on =3D=3D undefined) {
on =3D !document.body.classList.contains('toc-sidebar');
}
/* Don=E2=80=99t scroll to compensate for the ToC if we=E2=80=99re abov=
e it already. */
var headY =3D 0;
var head =3D document.querySelector('.head');
if (head) {
// terrible approx of "top of ToC"
headY +=3D head.offsetTop + head.offsetHeight;
}
var skipScroll =3D window.scrollY < headY;
var toggle =3D document.getElementById('toc-toggle');
var tocNav =3D document.getElementById('toc');
if (on) {
var tocHeight =3D tocNav.offsetHeight;
document.body.classList.add('toc-sidebar');
document.body.classList.remove('toc-inline');
toggle.innerHTML =3D collapseSidebarText;
if (!skipScroll) {
window.scrollBy(0, 0 - tocHeight);
}
tocNav.focus();
sidebarMedia.addListener(autoToggle); // auto-collapse when out of ro=
om
}
else {
document.body.classList.add('toc-inline');
document.body.classList.remove('toc-sidebar');
toggle.innerHTML =3D expandSidebarText;
if (!skipScroll) {
window.scrollBy(0, tocNav.offsetHeight);
}
if (toggle.matches(':hover')) {
/* Unfocus button when not using keyboard navigation,
because I don=E2=80=99t know where else to send the focus. */
toggle.blur();
}
}
}
function createSidebarToggle() {
/* Create the sidebar toggle in JS; it shouldn=E2=80=99t exist when JS =
is off. */
var toggle =3D document.createElement('a');
/* This should probably be a button, but appearance isn=E2=80=99t sta=
ndards-track.*/
toggle.id =3D 'toc-toggle';
toggle.class =3D 'toc-toggle';
toggle.href =3D '#toc';
toggle.innerHTML =3D collapseSidebarText;
sidebarMedia.addListener(autoToggle);
var toggler =3D function(e) {
e.preventDefault();
sidebarMedia.removeListener(autoToggle); // persist explicit off stat=
es
toggleSidebar();
return false;
}
toggle.addEventListener('click', toggler, false);
/* Get <nav id=3Dtoc-nav>, or make it if we don=E2=80=99t have one. */
var tocNav =3D document.getElementById('toc-nav');
if (!tocNav) {
tocNav =3D document.createElement('p');
tocNav.id =3D 'toc-nav';
/* Prepend for better keyboard navigation */
document.body.insertBefore(tocNav, document.body.firstChild);
}
/* While we=E2=80=99re at it, make sure we have a Jump to Toc link. */
var tocJump =3D document.getElementById('toc-jump');
if (!tocJump) {
tocJump =3D document.createElement('a');
tocJump.id =3D 'toc-jump';
tocJump.href =3D '#toc';
tocJump.innerHTML =3D tocJumpText;
tocNav.appendChild(tocJump);
}
tocNav.appendChild(toggle);
}
var toc =3D document.getElementById('toc');
if (toc) {
createSidebarToggle();
toggleSidebar(sidebarMedia.matches);
/* If the sidebar has been manually opened and is currently overlaying =
the text
(window too small for the MQ to add the margin to body),
then auto-close the sidebar once you click on something in there. */
toc.addEventListener('click', function(e) {
if(e.target.tagName.toLowerCase() =3D=3D "a" && document.body.classLi=
st.contains('toc-sidebar') && !sidebarMedia.matches) {
toggleSidebar(false);
}
}, false);
}
else {
console.warn("Can=E2=80=99t find Table of Contents. Please use <nav id=
=3D'toc'> around the ToC.");
}
/* Wrap tables in case they overflow */
var tables =3D document.querySelectorAll(':not(.overlarge) > table.data, =
:not(.overlarge) > table.index');
var numTables =3D tables.length;
for (var i =3D 0; i < numTables; i++) {
var table =3D tables[i];
var wrapper =3D document.createElement('div');
wrapper.className =3D 'overlarge';
table.parentNode.insertBefore(wrapper, table);
wrapper.appendChild(table);
}
})();
</script>
<h2 class=3D"no-num no-ref heading settled" id=3D"references"><span class=
=3D"content">References</span><a class=3D"self-link" href=3D"https://tbble.=
github.io/WG21-void/dxxxxr0.html#references"></a></h2>
<h3 class=3D"no-num no-ref heading settled" id=3D"normative"><span class=
=3D"content">Normative References</span><a class=3D"self-link" href=3D"http=
s://tbble.github.io/WG21-void/dxxxxr0.html#normative"></a></h3>
<dl>
<dt id=3D"biblio-n4659">[N4659]
</dt><dd><a href=3D"https://wg21.link/n4659">Standard for Programming La=
nguage C++</a>. 2017-03-21. Working Draft. URL: <a href=3D"https://wg21.lin=
k/n4659">https://wg21.link/n4659</a>
</dd></dl>
<h3 class=3D"no-num no-ref heading settled" id=3D"informative"><span clas=
s=3D"content">Informative References</span><a class=3D"self-link" href=3D"h=
ttps://tbble.github.io/WG21-void/dxxxxr0.html#informative"></a></h3>
<dl>
<dt id=3D"biblio-ccg">[C++CG]
</dt><dd>Bjarne Stroustrup; Herb Sutter. <a href=3D"https://isocpp.githu=
b.io/CppCoreGuidelines/CppCoreGuidelines">C++ Core Guidelines</a>. URL: <a =
href=3D"https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines">https=
://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines</a>
</dd><dt id=3D"biblio-p0135r1">[P0135R1]
</dt><dd>Richard Smith. <a href=3D"https://wg21.link/p0135r1">Wording fo=
r guaranteed copy elision through simplified value categories</a>. 20 June =
2016. URL: <a href=3D"https://wg21.link/p0135r1">https://wg21.link/p0135r1<=
/a>
</dd><dt id=3D"biblio-p0146r1">[P0146R1]
</dt><dd>Matt Calabrese. <a href=3D"https://wg21.link/p0146r1">Regular V=
oid</a>. 11 February 2016. URL: <a href=3D"https://wg21.link/p0146r1">https=
://wg21.link/p0146r1</a>
</dd></dl></body></html>
------=_Part_461_169681495.1494688350756--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Sat, 13 May 2017 08:35:47 -0700 (PDT)
Raw View
------=_Part_401_1331156843.1494689747674
Content-Type: multipart/alternative;
boundary="----=_Part_402_1675766433.1494689747674"
------=_Part_402_1675766433.1494689747674
Content-Type: text/plain; charset="UTF-8"
On Saturday, May 13, 2017 at 11:12:30 AM UTC-4, Paul Hampson wrote:
>
> Based on feedback from a successful lightning talk at ACCU2017, I've
> written up a proposal to make void{} do always what void() does in
> expression context, like any other type.
>
"what you think it does" depends on who you are.
For example, I believe (and the standard backs me up) that `{}` syntax
means "initialize an object". Therefore, `void{}` should create a prvalue
object of type `void`, just as it would for any type `T`. But `void` is an
incomplete type; it cannot be created. Therefore, `void{}` should be
il-formed.
So to me, this very much does "what I think it does".
`{}` does not mean the same thing as `()`.
--
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/a4a4a650-62cb-446c-ad54-9544fac859c8%40isocpp.org.
------=_Part_402_1675766433.1494689747674
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Saturday, May 13, 2017 at 11:12:30 AM UTC-4, Paul Hamps=
on wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: =
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">Base=
d on feedback from a successful lightning talk at ACCU2017, I've writte=
n up a proposal to make <font face=3D"times new roman, serif">void{}</font>=
do always what <font face=3D"times new roman, serif">void()</font> does in=
expression context, like any other type.</div></blockquote><div><br>"=
what you think it does" depends on who you are.<br><br>For example, I =
believe (and the standard backs me up) that `{}` syntax means "initial=
ize an object". Therefore, `void{}` should create a prvalue object of =
type `void`, just as it would for any type `T`. But `void` is an incomplete=
type; it cannot be created. Therefore, `void{}` should be il-formed.<br><b=
r>So to me, this very much does "what I think it does".<br><br>`{=
}` does not mean the same thing as `()`.<br></div></div>
<p></p>
-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/a4a4a650-62cb-446c-ad54-9544fac859c8%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/a4a4a650-62cb-446c-ad54-9544fac859c8=
%40isocpp.org</a>.<br />
------=_Part_402_1675766433.1494689747674--
------=_Part_401_1331156843.1494689747674--
.
Author: inkwizytoryankes@gmail.com
Date: Sat, 13 May 2017 08:38:07 -0700 (PDT)
Raw View
------=_Part_490_181889823.1494689887760
Content-Type: multipart/alternative;
boundary="----=_Part_491_1643864061.1494689887760"
------=_Part_491_1643864061.1494689887760
Content-Type: text/plain; charset="UTF-8"
On Saturday, May 13, 2017 at 5:12:30 PM UTC+2, Paul Hampson wrote:
>
> Based on feedback from a successful lightning talk at ACCU2017, I've
> written up a proposal to make void{} do always what void() does in
> expression context, like any other type.
>
> My draft is visible at https://tbble.github.io/WG21-void/dxxxxr0.html,
> and I've attached the current version.
>
> I realise this is a rather small thing to write a proposal for (it maybe
> should have been a defect report?) but it's also practice for me, as I'm
> helping out with another larger proposal (
> https://github.com/WG21-SG14/SG14-comparing-virtual-functions) and needed
> to get some practice time in with the tools, writing, and the process
> itself.
>
I agree this is small change but it is important, this is useless corner
case that should be removed from langrage. Fixing this in standard will
probably take less time than manually work around this problem every time
someone stumble on this.
--
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/8a25b8fe-8ef6-441d-86ef-0612a883eebf%40isocpp.org.
------=_Part_491_1643864061.1494689887760
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Saturday, May 13, 2017 at 5:12:30 PM UTC+2, Pau=
l Hampson wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin=
-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"lt=
r">Based on feedback from a successful lightning talk at ACCU2017, I've=
written up a proposal to make <font face=3D"times new roman, serif">void{}=
</font> do always what <font face=3D"times new roman, serif">void()</font> =
does in expression context, like any other type.<div><br></div><div>My draf=
t is visible at=C2=A0<a href=3D"https://tbble.github.io/WG21-void/dxxxxr0.h=
tml" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D'htt=
ps://www.google.com/url?q\x3dhttps%3A%2F%2Ftbble.github.io%2FWG21-void%2Fdx=
xxxr0.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFlPbE5sxWbodAw5mgCXvCVat=
-i4g';return true;" onclick=3D"this.href=3D'https://www.google.com/=
url?q\x3dhttps%3A%2F%2Ftbble.github.io%2FWG21-void%2Fdxxxxr0.html\x26sa\x3d=
D\x26sntz\x3d1\x26usg\x3dAFQjCNFlPbE5sxWbodAw5mgCXvCVat-i4g';return tru=
e;">https://tbble.github.io/<wbr>WG21-void/dxxxxr0.html</a>, and I've a=
ttached the current version.</div><div><br></div><div>I realise this is a r=
ather small thing to write a proposal for (it maybe should have been a defe=
ct report?) but it's also practice for me, as I'm helping out with =
another larger proposal (<a href=3D"https://github.com/WG21-SG14/SG14-compa=
ring-virtual-functions" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"t=
his.href=3D'https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2F=
WG21-SG14%2FSG14-comparing-virtual-functions\x26sa\x3dD\x26sntz\x3d1\x26usg=
\x3dAFQjCNFYBErRVVpART2P7zTS7mF0M8shHQ';return true;" onclick=3D"this.h=
ref=3D'https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FWG21-=
SG14%2FSG14-comparing-virtual-functions\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dA=
FQjCNFYBErRVVpART2P7zTS7mF0M8shHQ';return true;">https://github.com/WG2=
1-SG14/<wbr>SG14-comparing-virtual-<wbr>functions</a>) and needed to get so=
me practice time in with the tools, writing, and the process itself.</div><=
/div></blockquote><div><br>I agree this is small change but it is important=
, this is useless corner case that should be removed from langrage. Fixing =
this in standard will probably take less time than manually work around thi=
s problem every time someone stumble on this.<br></div></div>
<p></p>
-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/8a25b8fe-8ef6-441d-86ef-0612a883eebf%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/8a25b8fe-8ef6-441d-86ef-0612a883eebf=
%40isocpp.org</a>.<br />
------=_Part_491_1643864061.1494689887760--
------=_Part_490_181889823.1494689887760--
.
Author: Paul Hampson <paul.hampson@pobox.com>
Date: Sat, 13 May 2017 08:59:44 -0700 (PDT)
Raw View
------=_Part_477_1063096960.1494691184998
Content-Type: multipart/alternative;
boundary="----=_Part_478_384101574.1494691184998"
------=_Part_478_384101574.1494691184998
Content-Type: text/plain; charset="UTF-8"
At the relevant point in the standard (postfix function-style type-cast
expressions), `()` would then also mean "initialise an object". The
difference between '()' and '{}' shows up later, when talking about _how_
to initialise the object.
I agree, it depends on who you are. _I_ think `void{}` means (or should
mean) 'expression of prvalue type void' (same as `void()`). I'm already
limited in the places I can use that expression by void's own rules, in
general I can't put it anywhere, so I never try to form an object out of it.
_I_ think P0135R1 (guaranteed copy elision) separated `{}` from
'initialises an object', with the intervening "result object", which is
explicitly excluded for `void`, as it is for prvalues used to compute the
value of an operand. As it happens, prvalues of type void can only be used
to compute the value of an operand, so this one is actually less of a
'void' exception and more of a reminder.
On Sunday, 14 May 2017 01:35:47 UTC+10, Nicol Bolas wrote:
>
> On Saturday, May 13, 2017 at 11:12:30 AM UTC-4, Paul Hampson wrote:
>>
>> Based on feedback from a successful lightning talk at ACCU2017, I've
>> written up a proposal to make void{} do always what void() does in
>> expression context, like any other type.
>>
>
> "what you think it does" depends on who you are.
>
> For example, I believe (and the standard backs me up) that `{}` syntax
> means "initialize an object". Therefore, `void{}` should create a prvalue
> object of type `void`, just as it would for any type `T`. But `void` is an
> incomplete type; it cannot be created. Therefore, `void{}` should be
> il-formed.
>
> So to me, this very much does "what I think it does".
>
> `{}` does not mean the same thing as `()`.
>
--
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/c886e0d7-be92-422c-a1b7-6c34f5c81f25%40isocpp.org.
------=_Part_478_384101574.1494691184998
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">At the relevant point in the standard (postfix function-st=
yle type-cast expressions), `()` would then also mean "initialise an o=
bject". The difference between '()' and '{}' shows up =
later, when talking about _how_ to initialise the object.<div><br></div><di=
v>I agree, it depends on who you are. _I_ think `void{}` means (or should m=
ean) 'expression of prvalue type void' (same as `void()`). I'm =
already limited in the places I can use that expression by void's own r=
ules, in general I can't put it anywhere, so I never try to form an obj=
ect out of it.</div><div><br></div><div>_I_ think P0135R1 (guaranteed copy =
elision) separated `{}` from 'initialises an object', with the inte=
rvening "result object", which is explicitly excluded for `void`,=
as it is for prvalues used to compute the value of an operand. As it happe=
ns, prvalues of type void can only be used to compute the value of an opera=
nd, so this one is actually less of a 'void' exception and more of =
a reminder.<br><br>On Sunday, 14 May 2017 01:35:47 UTC+10, Nicol Bolas wro=
te:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;=
border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">On Saturda=
y, May 13, 2017 at 11:12:30 AM UTC-4, Paul Hampson wrote:<blockquote class=
=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc s=
olid;padding-left:1ex"><div dir=3D"ltr">Based on feedback from a successful=
lightning talk at ACCU2017, I've written up a proposal to make <font f=
ace=3D"times new roman, serif">void{}</font> do always what <font face=3D"t=
imes new roman, serif">void()</font> does in expression context, like any o=
ther type.</div></blockquote><div><br>"what you think it does" de=
pends on who you are.<br><br>For example, I believe (and the standard backs=
me up) that `{}` syntax means "initialize an object". Therefore,=
`void{}` should create a prvalue object of type `void`, just as it would f=
or any type `T`. But `void` is an incomplete type; it cannot be created. Th=
erefore, `void{}` should be il-formed.<br><br>So to me, this very much does=
"what I think it does".<br><br>`{}` does not mean the same thing=
as `()`.<br></div></div></blockquote></div></div>
<p></p>
-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/c886e0d7-be92-422c-a1b7-6c34f5c81f25%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/c886e0d7-be92-422c-a1b7-6c34f5c81f25=
%40isocpp.org</a>.<br />
------=_Part_478_384101574.1494691184998--
------=_Part_477_1063096960.1494691184998--
.
Author: "'Johannes Schaub' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Sat, 13 May 2017 18:13:54 +0200
Raw View
The only reason I see personally, for why one might want to allow
this, is to support a default/value-initialized return object (such as
"return {};"). The ambiguity-resolution seems not to be so motivating,
as that can always be solved simply by putting extra parentheses
around the type (BTW a "void()" within sizeof, typeid etc does not
declare a function, but specifies a type. you may want to correct that
in the paper).
As such, you may want to change your example, by instead writing
"return {};". Because when you are already fine with repeating the
type name, you can easily write your return statement as "return
Return();". I see no problem with that, and advices such as "ES.23:
Prefer the {} initializer syntax" are based on personal taste and like
any rule-of-thumb, there may be exceptions. "Type()" is just as safe
as "Type{}". In fact, you can argue that "Type()" is yet safer because
"Type{}" allows the construction of unnamed references initialized by
temporaries, and therefore to hide this error:
int && f() { return decltype(f()){}; } // returns dangling reference
To clarify, I support your proposal, but I find it a bit poorly motivated.
2017-05-13 17:12 GMT+02:00 Paul Hampson <paul.hampson@pobox.com>:
> Based on feedback from a successful lightning talk at ACCU2017, I've written
> up a proposal to make void{} do always what void() does in expression
> context, like any other type.
>
> My draft is visible at https://tbble.github.io/WG21-void/dxxxxr0.html, and
> I've attached the current version.
>
> I realise this is a rather small thing to write a proposal for (it maybe
> should have been a defect report?) but it's also practice for me, as I'm
> helping out with another larger proposal
> (https://github.com/WG21-SG14/SG14-comparing-virtual-functions) and needed
> to get some practice time in with the tools, writing, and the process
> itself.
>
> --
> 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/c77bd9db-1be3-4a99-bd30-fb50ea074176%40isocpp.org.
--
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/CANu6V4W6y6sB10684R-x%2BsvT0Z6qWQHTOOsmpBw1_0N%2Bv%3DuFWQ%40mail.gmail.com.
.
Author: Paul Hampson <paul.hampson@pobox.com>
Date: Sat, 13 May 2017 09:36:28 -0700 (PDT)
Raw View
------=_Part_518_1830079775.1494693388467
Content-Type: multipart/alternative;
boundary="----=_Part_519_803497872.1494693388468"
------=_Part_519_803497872.1494693388468
Content-Type: text/plain; charset="UTF-8"
On Sunday, 14 May 2017 02:13:56 UTC+10, Johannes Schaub wrote:
[Lots of useful stuff]
Thank you for that useful feedback. I can see that the motivation is weak.
I've added both your issues to the tracker on github, and will address them.
--
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/59ee7972-412a-47be-8a59-8aea4b95949b%40isocpp.org.
------=_Part_519_803497872.1494693388468
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Sunday, 14 May 2017 02:13:56 UTC+10, Johannes Schaub w=
rote:<div>[Lots of useful stuff]<br><div><br></div><div>Thank you for that =
useful feedback. I can see that the motivation is weak. I've added both=
your issues to the tracker on github, and will address them.</div></div></=
div>
<p></p>
-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/59ee7972-412a-47be-8a59-8aea4b95949b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/59ee7972-412a-47be-8a59-8aea4b95949b=
%40isocpp.org</a>.<br />
------=_Part_519_803497872.1494693388468--
------=_Part_518_1830079775.1494693388467--
.
Author: Paul Hampson <paul.hampson@pobox.com>
Date: Sat, 13 May 2017 10:00:57 -0700 (PDT)
Raw View
------=_Part_531_1852925003.1494694857347
Content-Type: multipart/alternative;
boundary="----=_Part_532_212741618.1494694857347"
------=_Part_532_212741618.1494694857347
Content-Type: text/plain; charset="UTF-8"
On Sunday, 14 May 2017 02:13:56 UTC+10, Johannes Schaub wrote:
>
> As such, you may want to change your example, by instead writing
> "return {};".
>
I just started to do this, and then realised that it's a different
proposal: much more wider-ranging and heading towards
https://wg21.link/p0146r1. I'd be tempted to head there *next*. It touches
more areas, so has more risk.
The particular distinction I'm addressing is when you're in a position to
name the type or an alias/template parameter thereof, i.e the magic Type()
or Type{} => direct-initialised prvalue, with semi-handling of void.
I did actually suggest this as an exception for ES.23 in the C++ Core
Guidelines, but it was rejected as "better to fix the language." ^_^ I
probably need stronger motivation than that here.
Looking at it, it might make more sense to let void be zero-initialised
(doing nothing, like reference types) and then remove the exception in
8.2.3 completely.
I'll keep thinking about it. I still need to find a good motivating case
before I can push this forward.
--
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/7e2460e2-b317-47c2-bae7-3bf35f137742%40isocpp.org.
------=_Part_532_212741618.1494694857347
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Sunday, 14 May 2017 02:13:56 UTC+10, Johannes Schaub w=
rote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8e=
x;border-left: 1px #ccc solid;padding-left: 1ex;">As such, you may want to =
change your example, by instead writing
<br>"return {};".=C2=A0<br></blockquote><div><br></div><div>I jus=
t started to do this, and then realised that it's a different proposal:=
much more wider-ranging and heading towards https://wg21.link/p0146r1. I&#=
39;d be tempted to head there *next*. It touches more areas, so has more ri=
sk.</div><div><br></div><div>The particular distinction I'm addressing =
is when you're in a position to name the type or an alias/template para=
meter thereof, i.e the magic Type() or Type{} =3D> direct-initialised pr=
value, with semi-handling of void.</div><div><br></div><div><br></div><div>=
<div>I did actually suggest this as an exception for ES.23 in the C++ Core =
Guidelines, but it was rejected as "better to fix the language." =
^_^ I probably need stronger motivation than that here.</div></div><div><br=
></div><div>Looking at it, it might make more sense to let void be zero-ini=
tialised (doing nothing, like reference types) and then remove the exceptio=
n in 8.2.3 completely.</div><div><br></div><div>I'll keep thinking abou=
t it. I still need to find a good motivating case before I can push this fo=
rward.</div></div>
<p></p>
-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/7e2460e2-b317-47c2-bae7-3bf35f137742%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/7e2460e2-b317-47c2-bae7-3bf35f137742=
%40isocpp.org</a>.<br />
------=_Part_532_212741618.1494694857347--
------=_Part_531_1852925003.1494694857347--
.
Author: "'Johannes Schaub' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Sat, 13 May 2017 19:24:29 +0200
Raw View
Well, I think the best argument about {} is that it is uniform. It
works in all the initialization scenarios in the language, and there's
no "here you need to name the type, here it is an ambiguity and here
you can only provide >= 1 initialization arguments. and here it's a
cast instead of an initialization". If you now introduce a special
case for void - i.e "void{}" is fine, but "void f() { return {}; }" is
not, then that's against the ideas of uniform initialization as I
understand it.
2017-05-13 19:00 GMT+02:00 Paul Hampson <paul.hampson@pobox.com>:
> On Sunday, 14 May 2017 02:13:56 UTC+10, Johannes Schaub wrote:
>>
>> As such, you may want to change your example, by instead writing
>> "return {};".
>
>
> I just started to do this, and then realised that it's a different proposal:
> much more wider-ranging and heading towards https://wg21.link/p0146r1. I'd
> be tempted to head there *next*. It touches more areas, so has more risk.
>
> The particular distinction I'm addressing is when you're in a position to
> name the type or an alias/template parameter thereof, i.e the magic Type()
> or Type{} => direct-initialised prvalue, with semi-handling of void.
>
>
> I did actually suggest this as an exception for ES.23 in the C++ Core
> Guidelines, but it was rejected as "better to fix the language." ^_^ I
> probably need stronger motivation than that here.
>
> Looking at it, it might make more sense to let void be zero-initialised
> (doing nothing, like reference types) and then remove the exception in 8.2.3
> completely.
>
> I'll keep thinking about it. I still need to find a good motivating case
> before I can push this forward.
>
> --
> 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/7e2460e2-b317-47c2-bae7-3bf35f137742%40isocpp.org.
--
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/CANu6V4XzM4H_WQ5x7f_9hc5Nu%2BSB_sFzpjNG6x820VRbFuGhkQ%40mail.gmail.com.
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Sat, 13 May 2017 11:59:38 -0700 (PDT)
Raw View
------=_Part_545_1184453705.1494701978129
Content-Type: multipart/alternative;
boundary="----=_Part_546_2036485534.1494701978129"
------=_Part_546_2036485534.1494701978129
Content-Type: text/plain; charset="UTF-8"
On Saturday, May 13, 2017 at 1:24:31 PM UTC-4, Johannes Schaub wrote:
>
> Well, I think the best argument about {} is that it is uniform. It
> works in all the initialization scenarios in the language, and there's
> no "here you need to name the type, here it is an ambiguity and here
> you can only provide >= 1 initialization arguments. and here it's a
> cast instead of an initialization". If you now introduce a special
> case for void - i.e "void{}" is fine, but "void f() { return {}; }" is
> not, then that's against the ideas of uniform initialization as I
> understand it.
>
But there's nothing being initialized. So it makes no sense to use "uniform
initialization" syntax to not initialize something.
If `void` becomes a regular type, and you can create objects of that type,
then using list initialization makes sense. But so long as there can be no
objects of type `void`, it makes no sense to claim to be able to initialize
them.
--
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/81af52bd-7482-4709-89db-735a67d4df1d%40isocpp.org.
------=_Part_546_2036485534.1494701978129
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Saturday, May 13, 2017 at 1:24:31 PM UTC-4, Joh=
annes Schaub wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;mar=
gin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Well, I thi=
nk the best argument about {} is that it is uniform. It
<br>works in all the initialization scenarios in the language, and there=
9;s
<br>no "here you need to name the type, here it is an ambiguity and he=
re
<br>you can only provide >=3D 1 initialization arguments. and here it=
9;s a
<br>cast instead of an initialization". If you now introduce a special
<br>case for void - i.e "void{}" is fine, but "void f() { re=
turn {}; }" is
<br>not, then that's against the ideas of uniform initialization as I
<br>understand it.<br></blockquote><div><br>But there's nothing being i=
nitialized. So it makes no sense to use "uniform initialization" =
syntax to not initialize something.</div><br>If `void` becomes a regular ty=
pe, and you can create objects of that type, then using list initialization=
makes sense. But so long as there can be no objects of type `void`, it mak=
es no sense to claim to be able to initialize them.<br></div>
<p></p>
-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/81af52bd-7482-4709-89db-735a67d4df1d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/81af52bd-7482-4709-89db-735a67d4df1d=
%40isocpp.org</a>.<br />
------=_Part_546_2036485534.1494701978129--
------=_Part_545_1184453705.1494701978129--
.
Author: "'Johannes Schaub' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Sat, 13 May 2017 21:04:51 +0200
Raw View
2017-05-13 20:59 GMT+02:00 Nicol Bolas <jmckesson@gmail.com>:
>
>
> On Saturday, May 13, 2017 at 1:24:31 PM UTC-4, Johannes Schaub wrote:
>>
>> Well, I think the best argument about {} is that it is uniform. It
>> works in all the initialization scenarios in the language, and there's
>> no "here you need to name the type, here it is an ambiguity and here
>> you can only provide >= 1 initialization arguments. and here it's a
>> cast instead of an initialization". If you now introduce a special
>> case for void - i.e "void{}" is fine, but "void f() { return {}; }" is
>> not, then that's against the ideas of uniform initialization as I
>> understand it.
>
>
> But there's nothing being initialized. So it makes no sense to use "uniform
> initialization" syntax to not initialize something.
>
Well the same is true for "decltype(int{})". Here we initialize no
object (and it's in particular true also for class types starting with
C++17). I think this is splitting hairs on terms. For the user, it's
irrelevant whether in some particular case we initialize or don't
initialize something when they use the uniform initialization syntax.
> If `void` becomes a regular type, and you can create objects of that type,
> then using list initialization makes sense. But so long as there can be no
> objects of type `void`, it makes no sense to claim to be able to initialize
> them.
>
I have no objection to that argument, as long as list initialization
stays uniform: void{} should not be allowed then either, on the basis
of your argument.
--
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/CANu6V4V7oqigGYHihg_qimX1NA8p07Wn-PFFjR_VOY-99NAbEQ%40mail.gmail.com.
.