220 38881 <d15af942-2e06-4384-b1a5-0fc8cafcd00f@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: mihailnajdenov@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Concepts: Investigating implicit type-name introduction
Date: Thu, 28 Jun 2018 01:54:33 -0700 (PDT)
Lines: 201
Approved: news@gmane.org
Message-ID: <d15af942-2e06-4384-b1a5-0fc8cafcd00f@isocpp.org>
References: <0c0da3b7-02f4-4130-9441-5a1385864d39@isocpp.org>
 <288df009-04d7-404a-b1ed-07b6bd9a71a3@isocpp.org>
 <GQT2wsDfpqpglaSteBw1YjqmaWWafx7K0teqMg6HatmMjaJAOTOvzypvGdi_PSVK4etKJDZMIwD5fNmV3rMaqQaKgVZ7relKQTkLFMEiKPk=@miator.net>
 <427de55b-9ff8-407f-802c-8902422d4746@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2415_1274319483.1530176073417"
X-Trace: blaine.gmane.org 1530175955 32415 195.159.176.226 (28 Jun 2018 08:52:35 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 28 Jun 2018 08:52:35 +0000 (UTC)
Cc: mihailnajdenov@gmail.com, zy@miator.net
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCUJ3A7GRAPRBSWE2LMQKGQEGVAYHHI@isocpp.org Thu Jun 28 10:52:31 2018
Return-path: <std-proposals+bncBCUJ3A7GRAPRBSWE2LMQKGQEGVAYHHI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yb0-f200.google.com ([209.85.213.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCUJ3A7GRAPRBSWE2LMQKGQEGVAYHHI@isocpp.org>)
	id 1fYSfG-0008EP-Ig
	for gclcip-std-proposals@m.gmane.org; Thu, 28 Jun 2018 10:52:30 +0200
Original-Received: by mail-yb0-f200.google.com with SMTP id l132-v6sf3338650ybb.18
        for <gclcip-std-proposals@m.gmane.org>; Thu, 28 Jun 2018 01:54:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=To1E7VPFe2vuDSGaZLs3f6oZSX5PnUBxs3DD6Jmtk9g=;
        b=VCorAL3GkzhAQOMoGBQvGY+d3iRjvWANeerUqJMEZsf9kbMXZKEPevVufF6PE/sXb9
         WbyF4uvRNaBb6o6JbB7hF2UK63E29c6yop6D1J/5U9VdP/67TXgvwHqWXc7EUweUFXXf
         rOnkDmNOq1rb2rnjT28fo97Aog9UT19rI9x7cPO8b8G99HHucK3Th4tSKGrhjWK+x6FQ
         S03k5Edc4YGlZiZikEeQL1nh1JxDY4/SkTR4GKDX2q+6DyDmaoLZvgLSOEo9Nnk4q7KT
         ua0rAoObg3adGwyLkCsMzuyIuGnv+yf+PNnEbVH0MWX/5k8aM15y3s+M24lYiljR4vN6
         4OcA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=To1E7VPFe2vuDSGaZLs3f6oZSX5PnUBxs3DD6Jmtk9g=;
        b=N9zbaVMZBXMLYC8gnV3a3NmTy6JRQvhte5ZIIiMJpnABdUdFas4Lq5vd+EoKEPPzf+
         kU/ZS5HqlkAL8a+fCpzmG+2g+qjeCqQLA6/elIzIdsfggLO5RIspoS5kJuYm5VdOyRUp
         l9XKekWkxK1luQ+WjJwipxBHVQ/040VSZSRdDXgbchnVxd5yKGFW1Z/TbZsLKWELGwuG
         dkZJsuoaeriUHhs0mbxBe3cjmnUVI2FpTEScf6SRIEc1rdcpszBJBmmcBmTDNdEG3hQM
         RfeI0ggFAB7hA6UDxg2s9OH6Z7VIXn0tOdJD72r+DIIPp1JJBgf5EvTbdeCrfJ7jirgg
         oDGA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=To1E7VPFe2vuDSGaZLs3f6oZSX5PnUBxs3DD6Jmtk9g=;
        b=p9HWJhgAjH+QaJQwHioQAtIawStBZFeQx4KCJ48R8+tE8E65JVKBIJDx2C2Xl6BJLs
         nz5DUvDXyIoXGRPT531RE2dU0awiM3HUQWFCnaW6qj4b9sA2SXnpA3ZPwpgIMfo9nExM
         JXLYFiELjeMuZJlgYU3dKjMe6At5SzO7kKvoc3nIfgEZmhpfXETtZZzynDqRQNpTghNj
         tuUHW0FbRrNuaK9b46u6WOv6rXSSViqLhhk1Ufmw3JPKicfh/3Fu8syqKgk5WShDOAPJ
         q6RonmUE/0xev4CQVjSo4Ka7//ZqMezgqfZMIpM23WWY1ueAbC99KkSBl75aH/6QnOEe
         mY7w==
X-Gm-Message-State: APt69E2glG0CNXXW1EZ14TPVwDsSTE5t21PwRoE8WCC0AvflTUeA3PJD
	Iv5O7Kyr4jNd2zRA5YvGEHL+1A==
X-Google-Smtp-Source: AAOMgpe3xzgWNJbJ/JSD5H8ZBEbi/WDfO+vI27o11SEdgmSOkCQsm6HQJoaDqioEwYXvGf/rZn1VYw==
X-Received: by 2002:a81:2809:: with SMTP id o9-v6mr2527791ywo.106.1530176075050;
        Thu, 28 Jun 2018 01:54:35 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a25:814e:: with SMTP id j14-v6ls2050043ybm.3.gmail; Thu, 28
 Jun 2018 01:54:34 -0700 (PDT)
X-Received: by 2002:a5b:60f:: with SMTP id d15-v6mr864065ybq.6.1530176073966;
        Thu, 28 Jun 2018 01:54:33 -0700 (PDT)
In-Reply-To: <427de55b-9ff8-407f-802c-8902422d4746@isocpp.org>
X-Original-Sender: MihailNajdenov@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:38881
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/38881>

------=_Part_2415_1274319483.1530176073417
Content-Type: multipart/alternative; 
	boundary="----=_Part_2416_1715642877.1530176073418"

------=_Part_2416_1715642877.1530176073418
Content-Type: text/plain; charset="UTF-8"



On Thursday, June 28, 2018 at 12:07:39 AM UTC+3, hubert.rein...@gmail.com 
wrote:
>
> On Wednesday, June 27, 2018 at 5:44:13 AM UTC-4, Zhihao Yuan wrote:
>>
>> Outside the debate of the you-know-that syntax, I think this
>> demand is easy to fulfill.  I think we can allow multi-argument
>> constrained parameters like this:
>>
>>     template <Mergeable In In2 Out, class Other>
>>     Out merge(In, In2, Out);
>>
> "Functions" whose arity are non-obvious are (in my opinion) an unfortunate 
> aspect of certain languages.
>
> K&R C gives us the perfectly usable idea of a list of identifiers that 
> introduce parameters; it even allows further attributes of the parameters 
> to be declared afterwards:
> int f(a, b, c)
>   int a, b, c;
> { return a + b + c; }
>
> Lines (statements ending in semicolons) could be used to apply constraints.
>
> template <In, In2, Out, Other>
> { Mergeable <In, In2, Out>; typename Other; }
> Out merge(In, In2, Out);
>

The idea is to be able to introduce the types entirely in terms of the 
concepts they represent so there would be less chance of errors. 
For instance someone might pass Other in the place of Out or swap In and 
In2 (this might or might not be a problem) and so on.

In any case, if we don't care of the repetition

template <typename In, In2, Out, Other>
  requires Mergeable<In, In2, Out>
Out merge(In, In2, Out);

is the best option


>
> That is perhaps not as short, but still shorter than:
> template <typename In, typename In2, typename Out, typename Other>
> requires Mergeable<In, In2, Out>
> Out merge(In, In2, Out);
>
 

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/d15af942-2e06-4384-b1a5-0fc8cafcd00f%40isocpp.org.

------=_Part_2416_1715642877.1530176073418
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Thursday, June 28, 2018 at 12:07:39 AM UTC+3, h=
ubert.rein...@gmail.com wrote:<blockquote class=3D"gmail_quote" style=3D"ma=
rgin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">=
<div dir=3D"ltr">On Wednesday, June 27, 2018 at 5:44:13 AM UTC-4, Zhihao Yu=
an wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.=
8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Outside the debate of=
 the you-know-that syntax, I think this<br></div><div>demand is easy to ful=
fill.=C2=A0 I think we can allow multi-argument<br></div><div>constrained p=
arameters like this:<br></div><div><br></div><div>=C2=A0=C2=A0=C2=A0 templa=
te &lt;Mergeable In In2 Out, class Other&gt;<br></div><div>=C2=A0 =C2=A0 Ou=
t merge(In, In2, Out);<br></div></blockquote><div>&quot;Functions&quot; who=
se arity are non-obvious are (in my opinion) an unfortunate aspect of certa=
in languages.<br><br>K&amp;R C gives us the perfectly usable idea of a list=
 of identifiers that introduce parameters; it even allows further attribute=
s of the parameters to be declared afterwards:<br><span style=3D"font-famil=
y:courier new,monospace">int f(a, b, c)<br>=C2=A0 int a, b, c;<br>{ return =
a + b + c; }</span><br><br>Lines (statements ending in semicolons) could be=
 used to apply constraints.<br><br><span style=3D"font-family:courier new,m=
onospace">template &lt;In, In2, Out, Other&gt;<br>{ Mergeable &lt;In, In2, =
Out&gt;; typename Other; }<br>Out merge(In, In2, Out);</span></div></div></=
blockquote><div><br></div><div>The idea is to be able to introduce the type=
s entirely in terms of the concepts they represent so there would be less c=
hance of errors.=C2=A0<br style=3D"background-attachment: scroll; backgroun=
d-clip: border-box; background-color: transparent; background-image: none; =
background-origin: padding-box; background-position-x: 0%; background-posit=
ion-y: 0%; background-repeat: repeat; background-size: auto; border-bottom-=
color: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px=
; border-image-outset: 0; border-image-repeat: stretch; border-image-slice:=
 100%; border-image-source: none; border-image-width: 1; border-left-color:=
 rgb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-r=
ight-color: rgb(34, 34, 34); border-right-style: none; border-right-width: =
0px; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-=
width: 0px; color: rgb(34, 34, 34); font-family: &amp;quot;Arial&amp;quot;,=
&amp;quot;Helvetica&amp;quot;,sans-serif; font-size: 13px; height: auto; ma=
rgin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min=
-width: 0px; overflow: visible; overflow-x: visible; overflow-y: visible; p=
adding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px=
;"></div><div><div style=3D"background-color: transparent; border-bottom-co=
lor: rgb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; =
border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 1=
00%; border-image-source: none; border-image-width: 1; border-left-color: r=
gb(34, 34, 34); border-left-style: none; border-left-width: 0px; border-rig=
ht-color: rgb(34, 34, 34); border-right-style: none; border-right-width: 0p=
x; border-top-color: rgb(34, 34, 34); border-top-style: none; border-top-wi=
dth: 0px; color: rgb(34, 34, 34); font-family: &amp;quot;Arial&amp;quot;,&a=
mp;quot;Helvetica&amp;quot;,sans-serif; font-size: 13px; font-style: normal=
; font-variant: normal; font-weight: 400; letter-spacing: normal; margin-bo=
ttom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2=
; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: =
0px; text-align: left; text-decoration: none; text-indent: 0px; text-transf=
orm: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacin=
g: 0px;">For instance someone might pass Other in the place of Out or swap =
In and In2 (this might or might not be a problem) and so on.<br></div></div=
><div><b></b><i></i><u></u><sub></sub><sup></sup><strike></strike><b></b><i=
></i><u></u><sub></sub><sup></sup><strike></strike><br></div><div>In any ca=
se, if we don&#39;t care of the repetition</div><div><br></div><div><span s=
tyle=3D"display: inline !important; float: none; background-color: transpar=
ent; color: rgb(34, 34, 34); font-family: courier new,monospace; font-size:=
 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-s=
pacing: normal; orphans: 2; text-align: left; text-decoration: none; text-i=
ndent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-spa=
ce: normal; word-spacing: 0px;">template &lt;typename In, In2, Out, Other&g=
t;</span><br style=3D"background-color: transparent; border-bottom-color: r=
gb(34, 34, 34); border-bottom-style: none; border-bottom-width: 0px; border=
-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; b=
order-image-source: none; border-image-width: 1; border-left-color: rgb(34,=
 34, 34); border-left-style: none; border-left-width: 0px; border-right-col=
or: rgb(34, 34, 34); border-right-style: none; border-right-width: 0px; bor=
der-top-color: rgb(34, 34, 34); border-top-style: none; border-top-width: 0=
px; color: rgb(34, 34, 34); font-family: courier new,monospace; font-size: =
13px; font-style: normal; font-variant: normal; font-weight: 400; letter-sp=
acing: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; mar=
gin-top: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-r=
ight: 0px; padding-top: 0px; text-align: left; text-decoration: none; text-=
indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-sp=
ace: normal; word-spacing: 0px;"><span style=3D"display: inline !important;=
 float: none; background-color: transparent; color: rgb(34, 34, 34); font-f=
amily: courier new,monospace; font-size: 13px; font-style: normal; font-var=
iant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-al=
ign: left; text-decoration: none; text-indent: 0px; text-transform: none; -=
webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">=C2=
=A0 requires Mergeable&lt;In, In2, Out&gt;</span><br style=3D"background-co=
lor: transparent; border-bottom-color: rgb(34, 34, 34); border-bottom-style=
: none; border-bottom-width: 0px; border-image-outset: 0; border-image-repe=
at: stretch; border-image-slice: 100%; border-image-source: none; border-im=
age-width: 1; border-left-color: rgb(34, 34, 34); border-left-style: none; =
border-left-width: 0px; border-right-color: rgb(34, 34, 34); border-right-s=
tyle: none; border-right-width: 0px; border-top-color: rgb(34, 34, 34); bor=
der-top-style: none; border-top-width: 0px; color: rgb(34, 34, 34); font-fa=
mily: courier new,monospace; font-size: 13px; font-style: normal; font-vari=
ant: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0px; =
margin-left: 0px; margin-right: 0px; margin-top: 0px; orphans: 2; padding-b=
ottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-a=
lign: left; text-decoration: none; text-indent: 0px; text-transform: none; =
-webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"><s=
pan style=3D"display: inline !important; float: none; background-color: tra=
nsparent; color: rgb(34, 34, 34); font-family: courier new,monospace; font-=
size: 13px; font-style: normal; font-variant: normal; font-weight: 400; let=
ter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; t=
ext-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; whit=
e-space: normal; word-spacing: 0px;">Out merge(In, In2, Out);</span><b></b>=
<i></i><u></u><sub></sub><sup></sup><strike></strike><br></div><div><b></b>=
<i></i><u></u><sub></sub><sup></sup><strike></strike><br></div><div>is the =
best option</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"=
margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;=
"><div dir=3D"ltr"><div><br><br>That is perhaps not as short, but still sho=
rter than:<br><span style=3D"font-family:courier new,monospace">template &l=
t;typename In, typename In2, typename Out, typename Other&gt;<br>requires M=
ergeable&lt;In, In2, Out&gt;<br>Out merge(In, In2, Out);</span></div></div>=
</blockquote><div>=C2=A0</div></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/d15af942-2e06-4384-b1a5-0fc8cafcd00f%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/d15af942-2e06-4384-b1a5-0fc8cafcd00f=
%40isocpp.org</a>.<br />

------=_Part_2416_1715642877.1530176073418--

------=_Part_2415_1274319483.1530176073417--

.
