220 39831 <1534441498.3721109.1476442920.71D445BF@webmail.messagingengine.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Henry Miller <hank@millerfarm.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: What do we want from named paramaters
Date: Thu, 16 Aug 2018 12:44:58 -0500
Lines: 86
Approved: news@gmane.org
Message-ID: <1534441498.3721109.1476442920.71D445BF@webmail.messagingengine.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: blaine.gmane.org 1534441375 25593 195.159.176.226 (16 Aug 2018 17:42:55 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 16 Aug 2018 17:42:55 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDQPBM7KRMDBBG7Q23NQKGQEODALRJQ@isocpp.org Thu Aug 16 19:42:51 2018
Return-path: <std-proposals+bncBDQPBM7KRMDBBG7Q23NQKGQEODALRJQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qt0-f200.google.com ([209.85.216.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDQPBM7KRMDBBG7Q23NQKGQEODALRJQ@isocpp.org>)
	id 1fqMIM-0006X3-KQ
	for gclcip-std-proposals@m.gmane.org; Thu, 16 Aug 2018 19:42:50 +0200
Original-Received: by mail-qt0-f200.google.com with SMTP id o18-v6sf4011430qtm.11
        for <gclcip-std-proposals@m.gmane.org>; Thu, 16 Aug 2018 10:45:01 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1534441501; cv=pass;
        d=google.com; s=arc-20160816;
        b=rNijxe9EzoZXyt9O6mXQQT9/U2D0AH+dqoA0iGabFLbqPj8BE9kv6ez16ZvZQksPhj
         Sl0GFIt4Maniyj8xmBoNyx5K169IUWlOwMCL3cdFNapUN+ExSx+iQ/bUZJQ5NUQnQVd/
         Uzzr/ZK3JhSZ87a2bbpmnc/J/Qe8fOqJYeWmcTDoKP6BqUecTg3UiL99wwDUcCT8tf9s
         gBe5t24QcPoos29JCsNWYVUdRBfjuIpf3/PuuvhHFK3drkaA5Vmk7IdMuhW/c3HhyqeZ
         EeOokCn79wbv3haoWg6FYmh8A+q90V/djjvAhc4K9H1z2WxpjtUYEcE6m9C4RT3Q4T2d
         EkRg==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:date:subject
         :content-transfer-encoding:mime-version:to:from:message-id
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=8OoYMGXwI99FuvNv0aIki6Rn7gcVATJcxWf+6k5KhSo=;
        b=a5z4jxmeSWozFmXcUgCBVZTFyCzOr2NdLguKy1FGNHF1G7V7YYMYcVlE3f3Tc0BJeE
         xQZjOcvFb/+Ubxiv2QvpoMPQ5HI6xHb8y8leftDWFCCLLpEQdJHH1gjNnlfe6qa3Tgwh
         ufiWCgn/jRxbUTpHy75ogq1s8P33+aX8syARmY4jeK+ftBrXvRYUWK95ToDx80eZpnfl
         rO9aQpHYGvRAMMjCdWoQO8HsspM++3E7ClLQJd4lUg4cP6W6atSsx0whWDxIROfVOW4G
         Wn5mkUh+ZY4IbHzZHLwhUffNfFTtkcHZ81YRYgPK3B7Fc8SljgiKTDoWJ1RVZLvONUMH
         1Fww==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=temperror (no key for signature) header.i=@millerfarm.com header.s=mesmtp header.b="LS5h/vj1";
       dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=UF24GRv7;
       spf=pass (google.com: domain of hank@millerfarm.com designates 66.111.4.25 as permitted sender) smtp.mailfrom=hank@millerfarm.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=message-id:from:to:mime-version:content-transfer-encoding:subject
         :date:x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=8OoYMGXwI99FuvNv0aIki6Rn7gcVATJcxWf+6k5KhSo=;
        b=CTC2pVnUR5x8Bv3KjlevO0T5zqqqbUu2ehEE7TqMpqWAjfHORLBJyEy34U64Hnah54
         ToleVUZ4AZtTn66QXOduf/k4UNTK71TLAE0NnPQe3B0AUNK7TLjNwdiwTAwGVtMu9hMn
         rpLAlriTDxu9y/eIzuGyeBFcK9NvR/gh8hHOU6PsnemuewUo5wcR+BGLRuqm35sU82/V
         KUWMqJO76yMkb4f7POq6mpjb2ivL4fSmfL311v9ejPUpxYpZ4/L/VFykQYm/wFjjE+AC
         2iNLFjVg89SqJre+rdDBn2hrjlno/n9qrtqgvyfc7ahES9FAX4TEAmoZUIWlwXgpP55H
         Kylg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:message-id:from:to:mime-version
         :content-transfer-encoding:subject:date: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=8OoYMGXwI99FuvNv0aIki6Rn7gcVATJcxWf+6k5KhSo=;
        b=D42JoB6M54CYW4hYFu00fyZWiWD4p576TQvPbqdtJpUzBV8kU1T8PQD+Ptc0s5cOGa
         ZydyasgaENOPWXQWLYRvdh0no3eK1fDwTnEAxIYR+SYOPM00npoyVfbUajaDE/ANWtrW
         ZJBDZ3mtRGBALQtwm2D4UfIx1sYwP0ZrySxvJDp9GBeMy/MaOrG3EvCXRKIwlmA+g9ZF
         q358/Z1htHv4bvzKJQATnUX2OiQLpzbU2kL6byQORk1W4KmbTd4V+HHt70OYhYiqc7PR
         kPcLCwiB8mtj4YIRhfkvQoHA6msgS9nzVoMFQ2cT+quaVUxYfaKsjVWf+KuaOAXULxnY
         dVng==
X-Gm-Message-State: AOUpUlGYsFr6IQyiK9jaoNBJtEM2v583koST+fv4bmyKj+OpQTo7LnxU
	guJ3lhc23lpOSBivMlX2rYVFjw==
X-Google-Smtp-Source: AA+uWPz5mBpxyGoHA80UOJ+GyLF/PznXNEiIAeWWEwodV9a+AHBC6BNCAvZNun/OjHLz5pEv4KTCeQ==
X-Received: by 2002:a0c:f68a:: with SMTP id p10-v6mr16035787qvn.62.1534441500952;
        Thu, 16 Aug 2018 10:45:00 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a37:5107:: with SMTP id f7-v6ls2791654qkb.9.gmail; Thu, 16
 Aug 2018 10:44:59 -0700 (PDT)
X-Received: by 2002:a37:aa4e:: with SMTP id t75-v6mr29930212qke.425.1534441499750;
        Thu, 16 Aug 2018 10:44:59 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1534441499; cv=none;
        d=google.com; s=arc-20160816;
        b=Fmd/pIOOjp06aZpPkahHr/Sltgzu4rhVs5Y2MxceRDqjMzDdezLlg/o9P2VDjS+apw
         kSkEMjg/nT5ouLxS/zsfsCZyiHBpcvN+08MiZlnQL3GlrpEYm9DFAKqh/5GVIWmjYSRp
         WFitCMEQq7QCiTucN9sYb5AW4xbUDCwaxGoG8hw3z/e48Vh5Y8p+x5v6wds9MCvARznB
         kHRGN6A8TZuIx9e9UPKueeaQj0w1Q/UYwfS88e/dCD4QE/7jvat6QbCasG2LTjnig6Tm
         rrBG8e3aK7Cu73OLDpwIU7xhNvD0rivrqK3XHYQ7KQ+1fpnXO8O2Cf4sUP+uRrqQyrXf
         JwVA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=date:subject:content-transfer-encoding:mime-version:to:from
         :message-id:dkim-signature:dkim-signature:arc-authentication-results;
        bh=xCMdVVbxtSvGCcstow9Cc8mj+IAK7yl2OpL4pvHj/Q4=;
        b=CBLqBHLOxiFOHR6Q8Db0gJ5QdabLb4CrBYWdLSdzXJo3yakk/V+q+5Z9W9bnJaowfE
         mtFX2rQUrNgAkXEdflmOFL8oMqWbl9B8dhOvAHz85Ax9sk1HrrtxSioDpv8m0pYNyLhl
         GuTJ+ImvhrrJ40xjGgHjOHo2VzK3Yy360QdH7ZD9Ro027MUsm2a7alBVJIcF0C7rS2V4
         Vg2jCeY+W6BC/LVtbcNjk16/sTt/Gr43d7bqwGwx0vBbsmTkBVttcyN8i+c4SZAIwckh
         XrxyYVUoXKAXkVS9DxiTJxKqiyGIV6ocsfeXaDoZdqCim+odVQFOlTmxjk+oYBivWXBm
         gOeQ==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=temperror (no key for signature) header.i=@millerfarm.com header.s=mesmtp header.b="LS5h/vj1";
       dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=UF24GRv7;
       spf=pass (google.com: domain of hank@millerfarm.com designates 66.111.4.25 as permitted sender) smtp.mailfrom=hank@millerfarm.com
Original-Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com. [66.111.4.25])
        by mx.google.com with ESMTPS id x6-v6si9326552qth.304.2018.08.16.10.44.59
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 16 Aug 2018 10:44:59 -0700 (PDT)
Received-SPF: pass (google.com: domain of hank@millerfarm.com designates 66.111.4.25 as permitted sender) client-ip=66.111.4.25;
Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
	by mailout.nyi.internal (Postfix) with ESMTP id 4F03221E44
	for <std-proposals@isocpp.org>; Thu, 16 Aug 2018 13:44:59 -0400 (EDT)
Original-Received: from web2 ([10.202.2.212])
  by compute4.internal (MEProxy); Thu, 16 Aug 2018 13:44:59 -0400
X-ME-Proxy: <xmx:Grh1W_OIXcW8jAGaiuax4Ki_TuLT0m1mwr8fRvPWqm8HgIzJu5TSug>
    <xmx:Grh1W6KXKkAZgQFlNvVNFEoZ-mBnO73SCB8ESkG0HuhFWCVDYnMKEw>
    <xmx:Grh1WwFlkANzxi-XXq2HsvzCG5aPSBvi2cskxjPWniFK2pGTkmCyEA>
    <xmx:Grh1WyRl7CMb5mHfTgzUywnTHjso02eE4Db5HoxNF29ULqdJK3JlSQ>
    <xmx:Grh1W8FTTcED7sUUesPQEDhTszjl-eOjTgZekHxBDhMp7vwFxBOCnQ>
    <xmx:G7h1WwKbJ7imc6VXR5ZFZDHRjGsCELFy2xzQi-GWYz91hgWzZwhvBA>
X-ME-Sender: <xms:Grh1Wy7eB62q8Nv5yHJWp-YU-E3e8cUs1UcLiddX9qjSBAjRsUG4TQ>
Original-Received: by mailuser.nyi.internal (Postfix, from userid 99)
	id BB754621BF; Thu, 16 Aug 2018 13:44:58 -0400 (EDT)
X-Mailer: MessagingEngine.com Webmail Interface - ajax-7b72137a
X-Original-Sender: hank@millerfarm.com
X-Original-Authentication-Results: mx.google.com;       dkim=temperror (no key
 for signature) header.i=@millerfarm.com header.s=mesmtp header.b="LS5h/vj1";
       dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=UF24GRv7;
       spf=pass (google.com: domain of hank@millerfarm.com designates
 66.111.4.25 as permitted sender) smtp.mailfrom=hank@millerfarm.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: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://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>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:39831
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/39831>


In the past couple months I've seen several proposals for names parameters.=
  Each with a list of pros and cons, and because there are cons arguments a=
gainst them.  I think we need a discussion on what we want assuming some st=
rawman acceptable syntax, and some thought of how many limitations in corne=
r cases we are willing to accept.=20

I can think of 4 uses for names parameters. (If you don't understand these =
I have simple code examples)
1 . a function with more than one parameter of the same type is called with=
 the parameters in the wrong order
      *  Some people want this to be a compilation error, some want the com=
piler to correct the problem and continue
2. a function wants to take the same type to mean different things in diffe=
rent contexts
3. it isn't obvious from the type alone what a parameter means
4. A function has a bunch of defaulted arguments and you want to change one=
 of the latter ones without specifying all the others

First question: is this complete?
Second, which problems are worth solving?
Third, for problems worth solving, which is the better solution, and how st=
rongly attached to it are you?

For the first the motivating code is something like:

class myMatrix {
     T GetCell(int row, int column);
     ...
};

in code:
   cell =3D matrix.GetCell(column, row);

This will compile just fine in C++17, but the code is undoubtedly wrong.  I=
n C++2n do you want this to be a compiler error, or correct code?


Second:
class point {
    point(double x, double y);=20
    point(double distance, double angle);
....
};

This code does not compile in C++17.  Do we want to make this case work?


Third:
class myString {
    int compare(myString, bool CaseSensitive);
....
};

in code
    if(str.compare(otherString, false) =3D=3D 0) ...   // what does this me=
an, why would you call compare and not compare?

This code is legal C++17, but it is user hostile. False in the context of r=
eading the function makes no intuitive sense.  Qt has created an enum for t=
his, but it can be argued that this is too heavy.  (you may or may not agre=
e with the argument)


Fourth:
// warning, marketing regularly changes the default value of this function
void foo(double a =3D 1234.5, int b =3D 6789);

foo(b:=3D1234);

This won't compile in C++17. However it seems like it would be useful to no=
t clutter function calls with default parameters that you don't care about.=
 In the case I gave it is a maintenance problem to update all uses of foo e=
very time the defaults change, though I'm not sure if this is actually a co=
mmon problem.

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/1534441498.3721109.1476442920.71D445BF%40webmail=
..messagingengine.com.

.
