220 40047 <fd3cd9e2-26fc-7770-0f82-182abd75134d@gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Matthew Woehlke <mwoehlke.floss@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Named Parameters for C++
Date: Mon, 27 Aug 2018 13:29:46 -0400
Lines: 65
Approved: news@gmane.org
Message-ID: <fd3cd9e2-26fc-7770-0f82-182abd75134d@gmail.com>
References: <CAPuuy5eBx1ybcPjS6dNsk7n1_c2uhdRBS19qr=q5cj3cTURnLQ@mail.gmail.com>
 <5d064165-5a58-4810-90f7-aa3732be92db@isocpp.org>
 <60449422-b543-4949-557a-96435c1c2926@technion.ac.il>
 <ecd10435-ac8d-1f59-8c73-cd3426eb0c47@gmail.com>
 <CAFx8YyuST_OvpK82pof3QDtWxjuFbKfkw33csjFan=aAqELBqQ@mail.gmail.com>
 <3e50834d-2e56-392f-fe30-8c24769d7647@gmail.com>
 <44b180b7-9c2f-48fe-9cf5-5b803b45f460@isocpp.org>
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 1535390864 1432 195.159.176.226 (27 Aug 2018 17:27:44 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 27 Aug 2018 17:27:44 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.9.1
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC37LBFWUIFBBDHKSDOAKGQEJ2SH3WQ@isocpp.org Mon Aug 27 19:27:40 2018
Return-path: <std-proposals+bncBC37LBFWUIFBBDHKSDOAKGQEJ2SH3WQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qk0-f198.google.com ([209.85.220.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC37LBFWUIFBBDHKSDOAKGQEJ2SH3WQ@isocpp.org>)
	id 1fuLIg-0000FA-Nx
	for gclcip-std-proposals@m.gmane.org; Mon, 27 Aug 2018 19:27:38 +0200
Original-Received: by mail-qk0-f198.google.com with SMTP id u195-v6sf15605424qka.14
        for <gclcip-std-proposals@m.gmane.org>; Mon, 27 Aug 2018 10:29:49 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1535390988; cv=pass;
        d=google.com; s=arc-20160816;
        b=qjxl1ZBpkjY06SsJziNYB9PHWb/QVs9MKqCnw5OlcyfFKHMqcU5sZTMBf2Gc2o1UTz
         8otGQA3HSRyYgKB5FVzlkwj0ekc5rqBUqVw9KpewV+4Ex05XIW92V5N7EqLfOVAk/o6K
         bNHnINArtE5U1vxzRjGNsIIzZPf+Dqxx0Ms748RxjbbokxvCf5vjegKz8/1Z3RoI6Qgq
         f+EbmxK8QvgrmqTnJVjkDnVx8ikCbmxBDZrOiiofEBE+yomFwxvk1NH57rkrt1eLMna7
         5Fv7si8QTQPD31Tz62KDi6soEzR16ROUBnBjpGtEgUuCzDNlNsw5XE2QPmh/DaxZBx3+
         dRIQ==
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:content-transfer-encoding
         :content-language:in-reply-to:mime-version:user-agent:date
         :message-id:openpgp:from:reply-to:to:references:subject
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=Gfv4QcpnAdxQjqZUuq7Vori7At8Bh/GurwtYH8TGyxs=;
        b=ly8Tj0oOcba3wE9zYqUPM15eKScluS+kiUKMwsx0u/YvRd/cqePE6R46Ns3DlSzuml
         af8UMpkWxi/zG0HqDbbaG8Rfz7ZeGTXwbQo1ptFmU6PR9Ol8xU6qoCAlHWi0940+Mxna
         +AKL4z89IMQfBfA2+R68z7T3PAH0+VLzrIdMJyDdafBKJ/m6aM3VeCYcutbEjIFhgYp7
         YUnlXXnd2vOeKKDxCyK6SzCd2Zd77Wpq8KLwKk3jTKoy8Un9GUVHacvr/ULtXDaBcMkQ
         p/lg+UjZxaXdWOIkSaMCT1DH1JxRox0JT6rwGHEHcYPU 
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=izxjPi1g;
       spf=pass (google.com: domain of mwoehlke.floss@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=mwoehlke.floss@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=subject:references:to:reply-to:from:openpgp:message-id:date
         :user-agent:mime-version:in-reply-to:content-language
         :content-transfer-encoding:x-original-sender
         :x-original-authentication-results:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=Gfv4QcpnAdxQjqZUuq7Vori7At8Bh/GurwtYH8TGyxs=;
        b=Ctm/kJOzSuXD8djcbjioTkbTyhS5u9dY1sUwue1d/Yayk422Yc1tRWih8JTc+WRqUa
         WB4YHvz/DH0myoXOnk+wdB0Y43POlWD9DCQ7s5g2/KX7tDkjkSvkeDx3UGCG6yZN3dO8
         2owxWfIsxc2ye+YRPoQnoBBAiospkMY55lesL8n5N/J10K3cupRX3RjR1zb4hAi96H0O
         i7JWJYKrRBTpczVnRkbyPpeqZSZWEeFLe4NV61KrzKEdenVzlBYui4xEQQ9FUjYRZJcH
         9RUz4xCyII8ZZCxM/5TmkmLrGIhxdVvlXdTGjK893JLPyRswPSkVlQuNPSmilTgRhH5B
     
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:subject:references:to:reply-to:from:openpgp
         :message-id:date:user-agent:mime-version:in-reply-to
         :content-language:content-transfer-encoding:x-original-sender
         :x-original-authentication-results:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=Gfv4QcpnAdxQjqZUuq7Vori7At8Bh/GurwtYH8TGyxs=;
        b=iuf6J0pyJb/H9JkagQHLVmXDL278GLgYUXz1Neveu8mVOOO30eO5cBcB9yQB1DXevH
         YJBQONvytT467aa67X+Oe7dYIoTj1oH6VLxhgH0fkLxx8dKmbzEUU6Nhbc0vz5/SxbNC
         usinV8x8i//Tu+UNyFaZXYBeQNLAi7H1jIjs3NHnF9pY1PT1gB6qekMnJbLi+AN4lYJK
         HujLrwXCHXeKhBGVBcva9tB7FMxH/LIk8bCbOimBjKvB2AQfD9NW+oGqhgeR6TBJDCC/
         AbBhwa2P1xeuVLBentxnCX47UxH7cXZkLUD 
X-Gm-Message-State: APzg51A8YGhwocPVFw5LgsqxMCdXBlS3cfWsprM0Ro3EEPD0KwXFp7rF
	tdeX1cOKfBrRtwZIO7w7Njfy6A==
X-Google-Smtp-Source: ANB0Vdb4+Tl5hko9txc80TdKt8fsghd3YzG1WX1nkp8rvSb/zboIYWuPUCrbLRvguNQGK5+3bhOnOQ==
X-Received: by 2002:ac8:1112:: with SMTP id c18-v6mr8634000qtj.13.1535390988825;
        Mon, 27 Aug 2018 10:29:48 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a37:313:: with SMTP id 19-v6ls1092783qkd.11.gmail; Mon, 27
 Aug 2018 10:29:47 -0700 (PDT)
X-Received: by 2002:a37:28d4:: with SMTP id o81-v6mr5597177qko.320.1535390987855;
        Mon, 27 Aug 2018 10:29:47 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1535390987; cv=none;
        d=google.com; s=arc-20160816;
        b=e/HnRDa/k2FHeVfF+CrEzkaNyBvHOxU76coSrBkifCAZ5gm4YUDOiq8ZPxpwQ1tZSv
         pY7oSwhawvwTKueGf44WiwUGGcShLPx8T9Yjea/UiCCzEU1ijyLqUiaxF9xyV1kJlrcY
         8RaTnI+jX1qwNUtr3NjIYucEAqhU9VltYW+3cNFxKEotJc8FPH844k55g51cfJD4csIw
         4D1EtXGmWgBc2v6swsfisBUxy3PrkeCn09l1tnvsC7JIpI0j5IixCdwouG+aInDe8j4x
         jX+adF3G27WFEGiUWiyRpYJQr5D+QyCd6TcZydzNA54rAooGOq3B6e2+Bom4Q5Dyd0r1
         nB5Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:content-language:in-reply-to:mime-version
         :user-agent:date:message-id:openpgp:from:reply-to:to:references
         :subject:dkim-signature:arc-authentication-results;
        bh=tegned/w8HMK1cjkVIliJc56uSEyY9M8DfAw/3Yuj6I=;
        b=RmDQs/haPYV3ZXOn0dVMhRLjnD6MGTXZu15sksc+XGIVY+cb5TBrAaM6b3F7MvS2M4
         cOEUsCa2zrfmeZaC5btSkOzP10K0coVM01zMWUg3lsONyK6aa73iZpVIiBHKqOSsyBlh
         O+fZN3aWndzQujkNq8dlyrNz/RiNOhFbU3reEfon0zRAHXYB2xkhseD1qIwKCsLCe225
         Rh9QP0iPYQOUtQSmx5jG4CnhMXGjzlagXN1G0rIALEdcEyKERbGWUKBEOvU/rPuefZuu
         buQLlhzU7j9jPjBHXseM/n2FwX8IolmQDrCMi/7zjr9db1dcl/7goJRd4CxsE9oYKcdZ
         FoBg==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=izxjPi1g;
       spf=pass (google.com: domain of mwoehlke.floss@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=mwoehlke.floss@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id k40-v6sor7757082qvf.39.2018.08.27.10.29.47
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Mon, 27 Aug 2018 10:29:47 -0700 (PDT)
Received-SPF: pass (google.com: domain of mwoehlke.floss@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 2002:a0c:d171:: with SMTP id c46-v6mr14579190qvh.142.1535390987441;
        Mon, 27 Aug 2018 10:29:47 -0700 (PDT)
Original-Received: from gryphon.kitware.com (tripoint.kitware.com. [66.194.253.20])
        by smtp.googlemail.com with ESMTPSA id n24-v6sm10210277qtf.0.2018.08.27.10.29.46
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Mon, 27 Aug 2018 10:29:46 -0700 (PDT)
Openpgp: preference=signencrypt
In-Reply-To: <44b180b7-9c2f-48fe-9cf5-5b803b45f460@isocpp.org>
Content-Language: en-US
X-Original-Sender: mwoehlke.floss@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=izxjPi1g;       spf=pass
 (google.com: domain of mwoehlke.floss@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=mwoehlke.floss@gmail.com;       dmarc=pass
 (p=NONE sp=QUARANTINE 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: <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:40047
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/40047>

On 2018-08-27 12:56, mihailnajdenov@gmail.com wrote:
> On Monday, August 27, 2018 at 7:22:44 PM UTC+3, Matthew Woehlke wrote:
>> On 2018-08-27 12:12, =D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB =D0=9D=D0=B0=
=D0=B9=D0=B4=D0=B5=D0=BD=D0=BE=D0=B2 wrote:=20
>>> How do you envision optional argument would work if we have only=20
>>> named-arguments-part-of-the-type?=20
>>
>> ...because named arguments are a special, "magic" type. Basically, when=
=20
>> the compiler sees that a function call has a named argument, it alters=
=20
>> the overload rules, so that the named argument doesn't have to match the=
=20
>> *current* argument, but *any* argument (excluding already matched=20
>> arguments).=20
>=20
> Will the arguments you envision be able to be marked as optional or not?

They can be defaulted:

  void foo(int .x, int .y=3D5, int .z=3D12);
  foo(2, .z=3D7); // okay, calls foo(2, 5, 7)

> Because this "optionality" must travel through the type system as well, t=
o=20
> be able to work with async/forward_as_typle
> This is not the case of "simple" strong names, which are "simply" mandato=
ry=20
> and "are just a different type".=20

I don't think that's the case:

  void invoke(Func f, tuple<int, named<int, "z">> args)
  {
    f(get<0>(args), get<1>(args));
  }
  invoke(foo, make_tuple(2, .z=3D7)); // okay, calls foo(2, 5, 7)

(Obviously, `invoke` is really a template, but I have shown the
instantiation that is called in the example.)

This will work with reordering also (if we allow it). I don't need to
know anything about optionality when I am forwarding arguments, just so
long as when I try to call the actual function, that succeeds with the
arguments I actually provided. Basically, by tying the name to each
argument, it passes through forwarding transparently, so that when I try
to call the "actual" function, the arguments the compiler sees look the
same as if the forwarding layer(s) weren't there.

....unless you're talking about something totally different when you talk
about "optionality"?

--=20
Matthew

--=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/fd3cd9e2-26fc-7770-0f82-182abd75134d%40gmail.com=
..

.
