220 39134 <zIsxha1LpjzhmMmtmntyw_j6dgG5s8r00BGQarW44h4_5u9Ek0MIqB3gQ5UTA5UmP_SPuHQGszrvXWCJulOp4vtuhN3QNNeUU3h8LJzAmLk=@miator.net> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Zhihao Yuan <zy@miator.net>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: RE: Re: Concept-defined placeholder type
Date: Fri, 13 Jul 2018 00:35:22 -0400
Lines: 91
Approved: news@gmane.org
Message-ID: <zIsxha1LpjzhmMmtmntyw_j6dgG5s8r00BGQarW44h4_5u9Ek0MIqB3gQ5UTA5UmP_SPuHQGszrvXWCJulOp4vtuhN3QNNeUU3h8LJzAmLk=@miator.net>
References: <wKt6BIikQ9kr3u_mQ2oR1vvx8Uj7JLabshrk6DkzkFXpExhOUcFUc_LbGjzKQ9Z_nsrjEQrvTE5d7-8FgpX_Q-dyOVcAUaiZdsCZZsX0ctQ=@miator.net>
 <0fe92570-1bc7-4a8b-aaf4-b272950f20af@isocpp.org>
 <HuI7FbT9Wv5a-_FWIr0Qhv9zmtfCrxYpONZ4G93vbE_K0pyko8Cri_ItEQhSio6bj6XfcssQc2UnmMTb93BpZaB1Ksw7q0GN0vS14warHAc=@miator.net>
 <8ba6d594-0aa8-4c6c-87b1-b785cc519570@isocpp.org>
 <u9P7LyPZrQx6zGIsGy_PNEv1uIc4hzJbsf9sRO0uy-CJlXbaz26rcV4FoSj4IB7dACZomroVEFOGMDGAXow0b0SXxQGdFlWr71rm2RhyaSo=@miator.net>
 <9df59e26-2363-4119-9794-090f958c4499@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 1531456405 17716 195.159.176.226 (13 Jul 2018 04:33:25 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 13 Jul 2018 04:33:25 +0000 (UTC)
To: 'Nicol Bolas' <jmckesson@gmail.com>, 'ISO C++ Standard - Future Proposals' <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCSKRWMD4EHBBEWYUDNAKGQELSLGUNQ@isocpp.org Fri Jul 13 06:33:20 2018
Return-path: <std-proposals+bncBCSKRWMD4EHBBEWYUDNAKGQELSLGUNQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wr1-f69.google.com ([209.85.221.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCSKRWMD4EHBBEWYUDNAKGQELSLGUNQ@isocpp.org>)
	id 1fdplg-0004XA-Ml
	for gclcip-std-proposals@m.gmane.org; Fri, 13 Jul 2018 06:33:20 +0200
Original-Received: by mail-wr1-f69.google.com with SMTP id d1-v6sf5146497wrr.4
        for <gclcip-std-proposals@m.gmane.org>; Thu, 12 Jul 2018 21:35:31 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1531456531; cv=pass;
        d=google.com; s=arc-20160816;
        b=eJVpnDyejujCBAuB2f6RRPIOK5+lKqEhCy7eZHsgtNrkZA2+e/aKozh5Dpkb6//9fX
         df0PQReeCwoFLl/n4aYSoX7a3c8PVWy6BIhioW1kcniZgWe4/KzlgSFyrICvoXHOkMTH
         jHZRmPXygYoCS4zyiBh7B/PSnAv/kBi233ULCHOEhHGFYy7sgOdM16r6TUWci5KGi0G9
         upzwRqRDqp3YnXkirhLw7UfA6DMGYKH+pBeytkxw5uamGmK3HZ4ARZTrF8XJp+45OySR
         FcIeigPTzxrfqh03gVgQnedIuwa1bmpoNH4sAjZBXeQc1Z81JBBBkM8uGe9+3iWxuSFK
         uWwQ==
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
         :mime-version:feedback-id:references:in-reply-to:message-id:subject
         :reply-to:from:to:date:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=BnHoxbXgnU9x2MniWcYzyMsYwg07B/nIcd19nUEnhT8=;
        b=ADVHJz1MEh8gS3uw0dJGmyC5HMhcPJLUUajJSXSjcxVgzLDGxMcTe+qSkC/GuctcH4
         qTyy0fYB7Mid9SqGoWbMeqPljS1uzy2h7Z8jGazWVzB+0mG2/8KIBsl/43cpldmJ3Q/B
         8Qgs8Q9wcBBBr6DhUYHX2hi/1iSzGH5yNFXxAW0FRMT8Tue5dseEOLXqEIAgcNcpYS/y
         E1u1Kj/DSe/zThVt/hIzoeCvDAXPPg6Npv8jtbU0VZkUKZ5N8CYWLDHDSty/lPJD0PAN
         cfzvhG5b4jyY124bsN+PFOqiMraAs6qxmBbg29fiEXTsODPMhrryMRxghyWhBAgpsx5+
          
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@miator.net header.s=protonmail header.b="v18ex/4Q";
       spf=pass (google.com: domain of zy@miator.net designates 185.70.40.18 as permitted sender) smtp.mailfrom=zy@miator.net
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:to:from:reply-to:subject:message-id:in-reply-to:references
         :feedback-id:mime-version: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=BnHoxbXgnU9x2MniWcYzyMsYwg07B/nIcd19nUEnhT8=;
        b=k33vsKWV+/PYrP8aBa/alfj6q5qZOlBqoErI1a8/Rsneij03M5snuWuJ6P5+pNNePT
         yOunDr7I41rfOQraL2mpj3zL+ZS1Ojwdt0oW6IC5LZzr2HuxJKKE9S+0FQAb6QCwuXvX
         PKdmINDH/ow5DQOe8wRCjo9/T63ktfvtO3XPFghkCnHLI5Im0lMAQZ95TLep2lUdh/Ae
         6S5ajbjTQrrRLLKZEt15hEf8fPCwP+MbMtqoTIw7PvBuCtV8835HwxjuGilXwvV8d6p8
         Q5wA5+uUdAKc7ueE+JVuk8l2kDn39WxSRAZ8O8edkhqo7F5Bj3NQe00qAJQp+iJTMgSs
         xg8g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:to:from:reply-to:subject:message-id
         :in-reply-to:references:feedback-id:mime-version
         :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=BnHoxbXgnU9x2MniWcYzyMsYwg07B/nIcd19nUEnhT8=;
        b=lx6pnjUo3JXhRUp+7S1VjjXU01JMaZxxmZh3KallNeWMVOAB3jAN4thkFli3FkZiEe
         vKCVJUMGsWQn+MmYJjjqusIp5OgXfP+3R7VgyAtqdJGgg14yOIGMEHcR1HZLY7xUK+Bs
         Cj/8oFGJ/1tSBwaB8xS+3+t9MHO3bZ5wV/6R06HnnXD3i16oqp1kZvzoj1U8eVPV8T3b
         3LcLXc2CH51jb7sB3fOxs2y53uKAZM5c1DhL70coa8ZM6vwTRBG70WEJk4esW05/mlRp
         vJar9Ip5oF5p3nSvGc+5hG951Vki65LoOIqO4kMRL7IW/T4xeeMyJhm+rGj 
X-Gm-Message-State: AOUpUlHaOtvt3V6otFLaHd1vKmeWRrTtZI7t7xEFVu3OWtsMlkWgGFwh
	CQG8EYMVMoDh2KeyVSYpN8xs9w==
X-Google-Smtp-Source: AAOMgpdX+6NTGn1QEpgj6RyZ4UNxhPbokt4hhtkKO9nqCpiihudpRR3CwM4jeoGj29FcTho+M08nDg==
X-Received: by 2002:adf:f911:: with SMTP id b17-v6mr486050wrr.3.1531456531604;
        Thu, 12 Jul 2018 21:35:31 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a1c:c90a:: with SMTP id f10-v6ls1535825wmb.8.canary-gmail;
 Thu, 12 Jul 2018 21:35:30 -0700 (PDT)
X-Received: by 2002:a1c:8e08:: with SMTP id q8-v6mr3101042wmd.137.1531456530565;
        Thu, 12 Jul 2018 21:35:30 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1531456530; cv=none;
        d=google.com; s=arc-20160816;
        b=XK0GYTU/pBDcvngMPF05W3dhlzPDRxQlAw3WrgQA/oyW2HOb3oJwe1S03ANnOG05tk
         4aVaU+dnkYNtCubU9GqyIwEcUbsNwcdW6gq6q/+22wdtWmPe7nICJs9SGXjUorNPdEWc
         fjFAkmS8tz971PManYPUNiltTRJlJKOCDaKfK9BNlWVNyzMLPdG10GekxvZifTIrkqwA
         jkBkf9zAefkmW2tpTf44Bc7p7rGUuxPV/05yRjODALqbzo+WAUhlydtq6DDBscbWjxHw
         rSlL+ntVMryfkQU7xVgde1LAGc7l6AWBnP4d94xGCS1PsbOEE9uUVSdVe1HRQALl5bJ4
         DEwg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:mime-version:feedback-id:references
         :in-reply-to:message-id:subject:reply-to:from:to:dkim-signature:date
         :arc-authentication-results;
        bh=QZtDc220Wsc6dLpiBvjccZWaS43uMbNGDs2ptsVaXmo=;
        b=V7TWRK7ksNtAQNOj7LhyL0zR/z56ClZrTnDwI53Z1XGwuRiBoK/r4WbiPSk0kM5ODO
         IFcgefX+oTPW6TpiI1YqoM6gjv4lKvkWK9StX94ACPSMyw1c4jWa3IyxoVXael3K+xW8
         cIDhyw4E/r5IpTqSa0UaOaEHK1asQIzUIhtVIP2x8GrJEDKspHxXZeEw6KxcTjHSYAu6
         oxh7WPsabDw9a9V4s2KwAVRqjwavTrqFWAV7EFFqUmo+bsIAi7wVrjIvhe+0r5e+1fon
         QnIiJtBa5xlgfzFWTCdRoJT8YabjRJO6ARN1nRWHFHMXw8awjCPBY3DtXXDLqYAJQ/Hs
         luPw==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@miator.net header.s=protonmail header.b="v18ex/4Q";
       spf=pass (google.com: domain of zy@miator.net designates 185.70.40.18 as permitted sender) smtp.mailfrom=zy@miator.net
Original-Received: from mail1.protonmail.ch (mail1.protonmail.ch. [185.70.40.18])
        by mx.google.com with ESMTPS id z140-v6si4818589wmd.190.2018.07.12.21.35.30
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 12 Jul 2018 21:35:30 -0700 (PDT)
Received-SPF: pass (google.com: domain of zy@miator.net designates 185.70.40.18 as permitted sender) client-ip=185.70.40.18;
In-Reply-To: <9df59e26-2363-4119-9794-090f958c4499@isocpp.org>
Feedback-ID: xu1i2ADzKwGyrUl8KbXpsa1PQSI0Bc21qlX1V7gpMylRDQPR42YBpWcLHW4brubvCmGM18xDo5tgsD-vWFu_cQ==:Ext:ProtonMail
X-Original-Sender: zy@miator.net
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@miator.net header.s=protonmail header.b="v18ex/4Q";       spf=pass
 (google.com: domain of zy@miator.net designates 185.70.40.18 as permitted
 sender) smtp.mailfrom=zy@miator.net
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:39134
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/39134>

From: Nicol Bolas <jmckesson@gmail.com>=20
Sent: Thursday, July 12, 2018 7:50 PM
>=20
> In order for your tool to be superior, you need to explain why:
>=20
> Concept T;
> T var =3D ...;
>=20
> is better than
>=20
> Concept auto var =3D ...;
> using T =3D decltype(var);
>=20
> There is no question that they both accomplish the same end. They both ar=
e two lines long.
>=20

The first one has 5 tokens, while the second one
has 11 tokens?

> No evidence shows that the time we use `auto` is=20
> getting close to the time we constrained-type-specifiers,=20
> there are plenty of cases where constraining is=20
> unnecessary.
>=20
> Um, if what you're saying is true, you do realize that you're arguing aga=
inst your own feature, right? Because if people don't want to constrain the=
ir deduced variables... what do we need your feature for?

I showed that there are cases you want to
constrain, it doesn't mean you *always* want to.

> My point is that your statement that there's no way for terse syntax to b=
e used for multiple deductions is incorrect. Maybe that particular syntax w=
ouldn't work (though since it's new syntax, we could require that constrain=
ed declarations make the number of variables match the number of template p=
arameters), but I mentioned other syntaxes that certainly could work.

It's not syntax's problem; logically it's not going to
work.  When you are defining two variables you
may have two declarations, how do you connect
and evaluate information from both without
naming them in some way?  If relying on variable
names then that's two decltypes, if relying on type-
names then that's my idea.

> Everything we're talking about is syntactic sugar. The effectiveness of s=
yntactic sugar is ultimately based on how commonly it will be used, and how=
 much of a pain the alternative is.
>=20

First, constrained-type-name is not a syntax sugar;
it's new entity.  Second, "shorthand" isn't the way
I look at the features.  Syntax must match intention,
that's the first criteria.  When you are deducing and
constraining two variables and want them to be of
the same type, the intention is "declaring two
variables of the same constrained deduced type."
And you should be able to read your code in that
way.  Now look at the following code:

    Copyable auto a =3D ...;
    decltype(a) b =3D ...;

How do you read the code, "declare a Copyable a,
then declare b to be of a's type?"  What about this:

    Copyable T;
    T a =3D ...;
    T b =3D ...;

"declare a and b to be of a Copyable T."  You have
a balanced intention, so you write code of this
balanced structure, that kind of syntax is what I'm
looking for.

--
Zhihao


--=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/zIsxha1LpjzhmMmtmntyw_j6dgG5s8r00BGQarW44h4_5u9E=
k0MIqB3gQ5UTA5UmP_SPuHQGszrvXWCJulOp4vtuhN3QNNeUU3h8LJzAmLk%3D%40miator.net=
..

.
