220 19865 <3646B3DF-F7F0-465D-8EE1-536E4CFB226B@gmail.com> article
Path: news.gmane.org!not-for-mail
From: David Krauss <potswa@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: default arguments
Date: Sun, 16 Aug 2015 08:19:49 +0800
Lines: 91
Approved: news@gmane.org
Message-ID: <3646B3DF-F7F0-465D-8EE1-536E4CFB226B@gmail.com>
References: <ef9c7cbe-e8f1-4196-83bc-11a1c9b2798c@isocpp.org> <4671850d-b823-436d-b097-f514073cc92e@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\))
Content-Type: multipart/alternative; boundary="Apple-Mail=_74117612-8957-4073-BC71-32E748042A2B"
X-Trace: ger.gmane.org 1439684406 9010 80.91.229.3 (16 Aug 2015 00:20:06 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 16 Aug 2015 00:20:06 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCW25A7E3QCRBLFOX6XAKGQES5IWBSY@isocpp.org Sun Aug 16 02:20:00 2015
Return-path: <std-proposals+bncBCW25A7E3QCRBLFOX6XAKGQES5IWBSY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ob0-f200.google.com ([209.85.214.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCW25A7E3QCRBLFOX6XAKGQES5IWBSY@isocpp.org>)
	id 1ZQlg5-0000FR-Ql
	for gclcip-std-proposals@m.gmane.org; Sun, 16 Aug 2015 02:19:57 +0200
Original-Received: by obbop1 with SMTP id op1sf158185810obb.3
        for <gclcip-std-proposals@m.gmane.org>; Sat, 15 Aug 2015 17:19:56 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:content-type:message-id:mime-version
         :subject:date:references:to:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=hGO3w0OlafYvixeCiW6DTmRN+rDvOLbNVyOoah9EkEA=;
        b=aI5e8F23d+L2uWk24OTC0MoQ6DAZF8PUKkWcX6UPmYy03mc+k3m4fyKlJTuSf58ZHL
         AphTyA/w0Mn1dZPFWIbFMPhAqWKrIFkfWCnvGYqpQzNqJnNSBgZmkCfQxLPLMLReOswH
         yCwh5g77LpdOdRN95KzOcPJVi7IHiOCw//8yFsD3npvotWKbRzVnYBzsfQRIoTUjTYl4
         b28n7TAACjzLhxKJx2gzk8cJNNpBIznvDJ3NCt6LCgflnGDaQlz0Ghg5hEsaFdFjxElb
         yh0LE48NGH61TRe4WGwk8aPzZM5hu35IoGbv3Er+oqHnnXWzgHtiP2T8ToPMWmpRRTWp
         oWrg==
X-Gm-Message-State: ALoCoQkpvbOgsHL6CLq097u080GbkbXwMytSqSBMN81+R8SWkqTAuxdMddqDUgA17+GCzIsa7IxP
X-Received: by 10.182.85.197 with SMTP id j5mr46437005obz.23.1439684396577;
        Sat, 15 Aug 2015 17:19:56 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.57.18 with SMTP id e18ls580436igq.23.gmail; Sat, 15 Aug
 2015 17:19:55 -0700 (PDT)
X-Received: by 10.66.141.141 with SMTP id ro13mr81100004pab.68.1439684395865;
        Sat, 15 Aug 2015 17:19:55 -0700 (PDT)
Original-Received: from mail-pd0-x22d.google.com (mail-pd0-x22d.google.com. [2607:f8b0:400e:c02::22d])
        by mx.google.com with ESMTPS id b5si16870186pbu.237.2015.08.15.17.19.55
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sat, 15 Aug 2015 17:19:55 -0700 (PDT)
Received-SPF: pass (google.com: domain of potswa@gmail.com designates 2607:f8b0:400e:c02::22d as permitted sender) client-ip=2607:f8b0:400e:c02::22d;
Original-Received: by pdrg1 with SMTP id g1so42838142pdr.2
        for <std-proposals@isocpp.org>; Sat, 15 Aug 2015 17:19:55 -0700 (PDT)
X-Received: by 10.70.56.66 with SMTP id y2mr101005570pdp.168.1439684395721;
        Sat, 15 Aug 2015 17:19:55 -0700 (PDT)
Original-Received: from [172.20.10.2] ([121.54.44.88])
        by smtp.gmail.com with ESMTPSA id hx7sm9868673pbc.84.2015.08.15.17.19.52
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sat, 15 Aug 2015 17:19:55 -0700 (PDT)
In-Reply-To: <4671850d-b823-436d-b097-f514073cc92e@isocpp.org>
X-Mailer: Apple Mail (2.2098)
X-Original-Sender: potswa@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of potswa@gmail.com designates 2607:f8b0:400e:c02::22d as permitted
 sender) smtp.mailfrom=potswa@gmail.com;       dkim=pass header.i=@gmail.com;
       dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:19865
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/19865>

--Apple-Mail=_74117612-8957-4073-BC71-32E748042A2B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2015=E2=80=9308=E2=80=9316, at 1:29 AM, Nicol Bolas <jmckesson@gmail.c=
om> wrote:
>=20
> My only concern is that it could tie up more useful syntax. With Uniform =
Initialization syntax, you can perform value initialization and constructio=
n initialization. But there's no way to generically use default initializat=
ion. So we might someday want `f(default)` to mean "default initialize the =
parameter".

C-style variadic arguments come close to implementing default-initialized (=
uninitialized) parameters. The receiver needs to explicitly make a decision=
 whether to access the parameter and assert that it was actually passed.

Default-initialized values, when distinct from value-initialized, are indet=
erminate. Parameter passing uses copy-initialization, and you usually can=
=E2=80=99t copy an indeterminate value. So f(default) would seem to be UB e=
xcept when the argument is a temporary passed by reference.

TL;DR: Default-initialized parameters, not very useful.

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--Apple-Mail=_74117612-8957-4073-BC71-32E748042A2B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><br class=3D""><di=
v><blockquote type=3D"cite" class=3D""><div class=3D"">On 2015=E2=80=9308=
=E2=80=9316, at 1:29 AM, Nicol Bolas &lt;<a href=3D"mailto:jmckesson@gmail.=
com" class=3D"">jmckesson@gmail.com</a>&gt; wrote:</div><br class=3D"Apple-=
interchange-newline"><div class=3D""><span style=3D"font-family: Helvetica;=
 font-size: 12px; font-style: normal; font-variant: normal; font-weight: no=
rmal; letter-spacing: normal; line-height: normal; orphans: auto; text-alig=
n: start; text-indent: 0px; text-transform: none; white-space: normal; wido=
ws: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; d=
isplay: inline !important;" class=3D"">My only concern is that it could tie=
 up more useful syntax. With Uniform Initialization syntax, you can perform=
 value initialization and construction initialization. But there's no way t=
o generically use default initialization. So we might someday want `f(defau=
lt)` to mean "default initialize the parameter".</span><br style=3D"font-fa=
mily: Helvetica; font-size: 12px; font-style: normal; font-variant: normal;=
 font-weight: normal; letter-spacing: normal; line-height: normal; orphans:=
 auto; text-align: start; text-indent: 0px; text-transform: none; white-spa=
ce: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px=
;" class=3D""></div></blockquote></div><br class=3D""><div class=3D"">C-sty=
le variadic arguments come close to implementing default-initialized (unini=
tialized) parameters. The receiver needs to explicitly make a decision whet=
her to access the parameter and assert that it was actually passed.</div><d=
iv class=3D""><br class=3D""></div><div class=3D"">Default-initialized valu=
es, when distinct from value-initialized, are indeterminate. Parameter pass=
ing uses copy-initialization, and you usually can=E2=80=99t copy an indeter=
minate value. So <font face=3D"Courier" class=3D"">f(default)</font> would =
seem to be UB except when the argument is a temporary passed by reference.<=
/div><div class=3D""><br class=3D""></div><div class=3D"">TL;DR: Default-in=
itialized parameters, not very useful.</div><div class=3D""><br class=3D"">=
</div></body></html>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--Apple-Mail=_74117612-8957-4073-BC71-32E748042A2B--

.
