220 19903 <CANh8DEnn-PWZRNUvqhjcaJpiZk+6hyxVpy5qQXgTUw-uMhdh1A@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: "'Matt Calabrese' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: default arguments
Date: Tue, 18 Aug 2015 11:12:13 -0700
Lines: 82
Approved: news@gmane.org
Message-ID: <CANh8DEnn-PWZRNUvqhjcaJpiZk+6hyxVpy5qQXgTUw-uMhdh1A@mail.gmail.com>
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/alternative; boundary=001a113cd41a7f3152051d99db51
X-Trace: ger.gmane.org 1439921542 686 80.91.229.3 (18 Aug 2015 18:12:22 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 18 Aug 2015 18:12:22 +0000 (UTC)
To: "ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCGNLO5F34OBB7PKZWXAKGQEA5WXM5Q@isocpp.org Tue Aug 18 20:12:18 2015
Return-path: <std-proposals+bncBCGNLO5F34OBB7PKZWXAKGQEA5WXM5Q@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pd0-f197.google.com ([209.85.192.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCGNLO5F34OBB7PKZWXAKGQEA5WXM5Q@isocpp.org>)
	id 1ZRlMt-0005f9-Qd
	for gclcip-std-proposals@m.gmane.org; Tue, 18 Aug 2015 20:12:16 +0200
Original-Received: by pdbpr2 with SMTP id pr2sf377009073pdb.3
        for <gclcip-std-proposals@m.gmane.org>; Tue, 18 Aug 2015 11:12:14 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:content-type: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=Mlu700m6ksuPmrxn6ZJ3N/dRyEP5GdheLOsqmli5By4=;
        b=YaaKo7Vlf5YCH72r+7BayoC3TaN+yCTlkzIW7vxDhjNVtAKwW24XgwEzPmWSDoB/ru
         epoOScZjKLjrHRMr/lfkPXTxOyAbNaiTxlqz9fhzq+WpVJv/wJmKybdStLsr34o/M3IB
         CpTMm6M9SAuPBAF0zAxMvff7vSGAvz+Deps7JuVo+lckbOhYEBsUDPgb9A1azPdux50w
         k0hAtsmhovg+QkXh9uGG729BRh/0hDU5Ao9mhqMk4oQIbMchFuo7wxNTxlELAclputS8
         Pv6+0VTryElj7t/ePv8TQhdCXQivHknvcHAwv0D46Rzqnugi7pyb3QYgXRvUobCibzcM
         75Sg==
X-Gm-Message-State: ALoCoQnqXLGvuQcgUscrQFLpSqUQtuqifBfJd65fUgIoCDezk5BAnanxs3ZidLgkCzKfKHxStqwD
X-Received: by 10.66.148.2 with SMTP id to2mr7007603pab.23.1439921534620;
        Tue, 18 Aug 2015 11:12:14 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.45.232 with SMTP id q8ls1179427obm.60.gmail; Tue, 18 Aug
 2015 11:12:13 -0700 (PDT)
X-Received: by 10.202.230.70 with SMTP id d67mr6805017oih.14.1439921533619;
        Tue, 18 Aug 2015 11:12:13 -0700 (PDT)
Original-Received: from mail-oi0-x231.google.com (mail-oi0-x231.google.com. [2607:f8b0:4003:c06::231])
        by mx.google.com with ESMTPS id op10si13006441oeb.77.2015.08.18.11.12.13
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 18 Aug 2015 11:12:13 -0700 (PDT)
Received-SPF: pass (google.com: domain of calabrese@google.com designates 2607:f8b0:4003:c06::231 as permitted sender) client-ip=2607:f8b0:4003:c06::231;
Original-Received: by oiev193 with SMTP id v193so104967736oie.3
        for <std-proposals@isocpp.org>; Tue, 18 Aug 2015 11:12:13 -0700 (PDT)
X-Received: by 10.202.95.138 with SMTP id t132mr6671318oib.55.1439921533285;
 Tue, 18 Aug 2015 11:12:13 -0700 (PDT)
Original-Received: by 10.60.55.234 with HTTP; Tue, 18 Aug 2015 11:12:13 -0700 (PDT)
In-Reply-To: <ef9c7cbe-e8f1-4196-83bc-11a1c9b2798c@isocpp.org>
X-Original-Sender: calabrese@google.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of calabrese@google.com designates 2607:f8b0:4003:c06::231 as
 permitted sender) smtp.mailfrom=calabrese@google.com;       dkim=pass
 header.i=@google.com;       dmarc=pass (p=REJECT dis=NONE) header.from=google.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>
X-Original-From: Matt Calabrese <calabrese@google.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:19903
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/19903>

--001a113cd41a7f3152051d99db51
Content-Type: text/plain; charset=UTF-8

On Sat, Aug 15, 2015 at 9:49 AM, Arthur Tchaikovsky <atch.cpp@gmail.com>
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?
>

Yes, I think it's useful. Yes, I think named arguments are more useful,
though while there is overlap, they don't exactly solve the same set of
problems. Even with named arguments you might potentially want/need
something like this when in the presence of overloads.

However, I think named arguments are considerably less likely to get into
the language due to their complexity, but those are just my thoughts on the
matter. Defaults as you present them are considerably simpler and I also
would not consider it an "anti-pattern."

So, +1 on this or a similar proposal.

-- 

--- 
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/.

--001a113cd41a7f3152051d99db51
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On S=
at, Aug 15, 2015 at 9:49 AM, Arthur Tchaikovsky <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:atch.cpp@gmail.com" target=3D"_blank">atch.cpp@gmail.com</a>&g=
t;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 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:<br><br>void f=
(int a =3D 0, int b =3D 1, int c =3D 2, int d =3D 3);<br><br>I think that i=
t would be nice to be able to say whilst calling it and requiring only some=
 of those args to be non-default:<br><br>f(default,2,default,4);<br><br>Tho=
ughts?</div></blockquote><div><br></div><div>Yes, I think it&#39;s useful. =
Yes, I think named arguments are more useful, though while there is overlap=
, they don&#39;t exactly solve the same set of problems. Even with named ar=
guments you might potentially want/need something like this when in the pre=
sence of overloads.</div><div><br></div><div>However, I think named argumen=
ts are considerably less likely to get into the language due to their compl=
exity, but those are just my thoughts on the matter. Defaults as you presen=
t them are considerably simpler and I also would not consider it an &quot;a=
nti-pattern.&quot;</div><div><br></div><div>So, +1 on this or a similar pro=
posal.</div></div></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&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 />

--001a113cd41a7f3152051d99db51--

.
