220 19863 <4671850d-b823-436d-b097-f514073cc92e@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: default arguments
Date: Sat, 15 Aug 2015 10:29:29 -0700 (PDT)
Lines: 89
Approved: news@gmane.org
Message-ID: <4671850d-b823-436d-b097-f514073cc92e@isocpp.org>
References: <ef9c7cbe-e8f1-4196-83bc-11a1c9b2798c@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2_1853422674.1439659769915"
X-Trace: ger.gmane.org 1439659778 23991 80.91.229.3 (15 Aug 2015 17:29:38 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 15 Aug 2015 17:29:38 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBB6XNXWXAKGQEG52RKLQ@isocpp.org Sat Aug 15 19:29:33 2015
Return-path: <std-proposals+bncBCEKFTV6ZUMBB6XNXWXAKGQEG52RKLQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pd0-f198.google.com ([209.85.192.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBB6XNXWXAKGQEG52RKLQ@isocpp.org>)
	id 1ZQfGu-0005ec-S9
	for gclcip-std-proposals@m.gmane.org; Sat, 15 Aug 2015 19:29:33 +0200
Original-Received: by pdbnh15 with SMTP id nh15sf171525302pdb.1
        for <gclcip-std-proposals@m.gmane.org>; Sat, 15 Aug 2015 10:29:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :content-type:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=xfolpeBWcmdxoSoWjwghxtYEaBbo8VZjhIjKca0RYs4=;
        b=fM02B9E/m9q8yAChsJItwsQ2fZkS3feWe/ZSfKMybpZS4anHQe6mLmJHqKr83frm3w
         2bx7TiIJhWqw+y4pg+B/wixvSXjn90lVQkEzaJsBustn/PergZoceY2vmpv37m9lwfyd
         CAZOBD5SackeLoztpIivWjCitE7CJxaXmmuYuWdfVtzBFm/OSomLx3vaLL4poycqAe8J
         C0qMqhzNE77Ws1CtErBqQtbWJ5dJOa8l+G4e5b+RG7ASo0zlUkMjmgOLiiFAHK1pSwlH
         EpCQkKT7LYDEs6a0eSrcEmksDxcHQl1PuOMffpzpPgkcJsWEjAlSUeRZa5siNbnR7/OR
         3eBQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:content-type:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=xfolpeBWcmdxoSoWjwghxtYEaBbo8VZjhIjKca0RYs4=;
        b=Ff7lz/qtTb4i+s9U1lySsaQSuB4Gakn+6FKnK67x7angcfMTDvGHI6+f63bpucJr9j
         57XyZjuUUL1OXPZYgSSn73oGpvIUMYM/uf3ODTKTUa1I80Xq4sNJtqeGrpD4ki2LaEhc
         bK8aKpp0VnN0/EU252gzV8k0VcdprQt/0U9ApxMUDiQWyfJULdRGc/pxfoAagHMWuIdx
         zXXD6foAxWuC0/k2GgpuCWJiX2klJVLQ4IdXdwJUCEJSCx4G2YAUSqUQtsWiPCbv9haw
         7L6B3VZUsOIYJEtdpsk6fHmStz52HRNfi4C9oyKj/Vx4qYrf9RByr4JDNV1rLLVAJBtp
         92Fg==
X-Gm-Message-State: ALoCoQkup7TCFRA2bwGqsY3CAQC0IbrnFmay+9nEoRRGmEn5TuDHXumXS2sIV7ZBdgm3QcAhviMe
X-Received: by 10.68.180.161 with SMTP id dp1mr25546207pbc.13.1439659771728;
        Sat, 15 Aug 2015 10:29:31 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.109.2 with SMTP id k2ls1723510qgf.79.gmail; Sat, 15 Aug
 2015 10:29:30 -0700 (PDT)
X-Received: by 10.140.104.115 with SMTP id z106mr339806qge.23.1439659770585;
        Sat, 15 Aug 2015 10:29:30 -0700 (PDT)
In-Reply-To: <ef9c7cbe-e8f1-4196-83bc-11a1c9b2798c@isocpp.org>
X-Original-Sender: jmckesson@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:19863
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/19863>

------=_Part_2_1853422674.1439659769915
Content-Type: multipart/alternative; 
	boundary="----=_Part_3_267507032.1439659769915"

------=_Part_3_267507032.1439659769915
Content-Type: text/plain; charset=UTF-8

On Saturday, August 15, 2015 at 12:49:50 PM UTC-4, Arthur Tchaikovsky wrote:
>
> Hi, 
> Does anyone see helpfulness of such solution:
> Having fnc:
>
> void f(int a = 0, int b = 1, int c = 2, int d = 3);
>
> I think that it would be nice to be able to say whilst calling it and 
> requiring only some of those args to be non-default:
>
> f(default,2,default,4);
>
> Thoughts?
>

This is probably the best language enhancement to default arguments I've 
seen (admittedly, that's not saying much, considering the quality of the 
others). It uses an existing keyword in a way that doesn't break existing 
code. It provides genuinely useful functionality, solving a (relatively 
minor) problem. And it would make it reasonable to define default arguments 
other than at the end of a parameter list.

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 to generically use default 
initialization. So we might someday want `f(default)` to mean "default 
initialize the parameter".

Then again, maybe we don't want that.

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_3_267507032.1439659769915
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Saturday, August 15, 2015 at 12:49:50 PM UTC-4, Arthur =
Tchaikovsky wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"=
ltr">Hi, <br>Does anyone see helpfulness of such solution:<br>Having fnc:<b=
r><br>void f(int a =3D 0, int b =3D 1, int c =3D 2, int d =3D 3);<br><br>I =
think that it would be nice to be able to say whilst calling it and requiri=
ng only some of those args to be non-default:<br><br>f(default,2,default,4)=
;<br><br>Thoughts?<br></div></blockquote><div><br>This is probably the best=
 language enhancement to default arguments I&#39;ve seen (admittedly, that&=
#39;s not saying much, considering the quality of the others). It uses an e=
xisting keyword in a way that doesn&#39;t break existing code. It provides =
genuinely useful functionality, solving a (relatively minor) problem. And i=
t would make it reasonable to define default arguments other than at the en=
d of a parameter list.<br><br>My only concern is that it could tie up more =
useful syntax. With Uniform Initialization syntax, you can perform value in=
itialization and construction initialization. But there&#39;s no way to gen=
erically use default initialization. So we might someday want `f(default)` =
to mean &quot;default initialize the parameter&quot;.<br><br>Then again, ma=
ybe we don&#39;t want that.<br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_3_267507032.1439659769915--
------=_Part_2_1853422674.1439659769915--

.
