220 19869 <mqtask$51j$1@ger.gmane.org> article
Path: news.gmane.org!not-for-mail
From: Bo Persson <bop@gmb.dk>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: default arguments
Date: Mon, 17 Aug 2015 20:58:28 +0200
Lines: 55
Approved: news@gmane.org
Message-ID: <mqtask$51j$1@ger.gmane.org>
References: <ef9c7cbe-e8f1-4196-83bc-11a1c9b2798c@isocpp.org>
 <736eb378-52a4-43ba-b3b5-a73719ba70af@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
X-Trace: ger.gmane.org 1439837932 5723 80.91.229.3 (17 Aug 2015 18:58:52 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 17 Aug 2015 18:58:52 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCZ6RLW3UIKBBXW5ZCXAKGQEARKHSXY@isocpp.org Mon Aug 17 20:58:42 2015
Return-path: <std-proposals+bncBCZ6RLW3UIKBBXW5ZCXAKGQEARKHSXY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-la0-f72.google.com ([209.85.215.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCZ6RLW3UIKBBXW5ZCXAKGQEARKHSXY@isocpp.org>)
	id 1ZRPcG-0007i4-N3
	for gclcip-std-proposals@m.gmane.org; Mon, 17 Aug 2015 20:58:41 +0200
Original-Received: by labia3 with SMTP id ia3sf50287028lab.1
        for <gclcip-std-proposals@m.gmane.org>; Mon, 17 Aug 2015 11:58:40 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:to:from:subject:date:lines:message-id:references
         :mime-version:content-type:user-agent: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=frP1zcZEKYVnmjpuBECx8nkTDzzTeHcJRHgMexUfv0k=;
        b=cckTHUQDskXuV8fBtNBvmdvWlRizNOT75QTP9QX0y+dQ9kcc2wN1OeJEHB5AXKBkuH
         tozHCIJx9K6oRKzfvxDJkLOQRnzy65voOzbhPbne8kAAKULDqdD3JhhQHKt8bOgKUHiU
         6YCuNKGCnd9kfc8NQmdZxym5oDzD8LcAxampql4v9cvdFI1BPCntY8qrRzkIFaGs7h6H
         xqGt1WOaKQJuk9w+rEMGYTZwG2YiQoSIPcHqvO7Q+jQu8u+JcbNcShCep9b3L+0HmVkb
         Viaejo/gXnaFQdV93iS9WYOpWDcmQ6kI76pfVL+KLVt52dnoWQu/VSw2HvgsdJId/9kD
         
X-Gm-Message-State: ALoCoQnPyhj38oVBCoIWD+0BJY4Wc4iooUmcjBRmyk4X0MLRgq5elWOwzeATO65tfTTwZj8TlNMQ
X-Received: by 10.180.35.162 with SMTP id i2mr5223965wij.6.1439837920363;
        Mon, 17 Aug 2015 11:58:40 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.37.196 with SMTP id a4ls579403lak.27.gmail; Mon, 17 Aug
 2015 11:58:38 -0700 (PDT)
X-Received: by 10.152.121.37 with SMTP id lh5mr2273875lab.2.1439837918295;
        Mon, 17 Aug 2015 11:58:38 -0700 (PDT)
Original-Received: from plane.gmane.org (plane.gmane.org. [80.91.229.3])
        by mx.google.com with ESMTPS id d10si12201377lae.52.2015.08.17.11.58.38
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Mon, 17 Aug 2015 11:58:38 -0700 (PDT)
Received-SPF: pass (google.com: domain of gclcip-std-proposals@m.gmane.org designates 80.91.229.3 as permitted sender) client-ip=80.91.229.3;
Original-Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gclcip-std-proposals@m.gmane.org>)
	id 1ZRPc9-0007ea-79
	for std-proposals@isocpp.org; Mon, 17 Aug 2015 20:58:33 +0200
Original-Received: from c-358fe655.021-326-6d6c6d10.cust.bredbandsbolaget.se ([85.230.143.53])
        by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <std-proposals@isocpp.org>; Mon, 17 Aug 2015 20:58:33 +0200
Original-Received: from bop by c-358fe655.021-326-6d6c6d10.cust.bredbandsbolaget.se with local (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <std-proposals@isocpp.org>; Mon, 17 Aug 2015 20:58:33 +0200
X-Injected-Via-Gmane: http://gmane.org/
Original-Lines: 46
Original-X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: c-358fe655.021-326-6d6c6d10.cust.bredbandsbolaget.se
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101
 Thunderbird/38.2.0
In-Reply-To: <736eb378-52a4-43ba-b3b5-a73719ba70af@isocpp.org>
X-Original-Sender: gclcip-std-proposals@m.gmane.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of gclcip-std-proposals@m.gmane.org designates 80.91.229.3 as
 permitted sender) smtp.mailfrom=gclcip-std-proposals@m.gmane.org
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:19869
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/19869>

On 2015-08-17 20:37, Arthur Tchaikovsky wrote:
> I would really appreciate some feedback from people, or is this proposal
> so uninteresting that there is no point in wasting keyboard on it?

You might wonder how widely used it will be?

If not all parameters are of the same type, you can already get some of 
the effect with a few overloads:

     void f(int a = 0, string b = "1",
            complex<double> c = 2.0, type4 d = 3);

     inline void f(int a, complex<double> c)
     { f(a, "1", c, 3); }

     inline void f(string b, complex<double> c)
     { f(0, b, c, 3); }

assuming that d is put last because you hardly ever want to change the 
default.

Just saying that you can already do this without a language change.


    Bo Persson



>
> On Saturday, 15 August 2015 17:49:50 UTC+1, 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?
>
>


-- 

--- 
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/.

.
