220 32371 <3657aeea-1787-40ee-9320-9b6e6466f061@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: When C++ will support unconstrained generic
 functions ?
Date: Tue, 9 May 2017 11:30:47 -0700 (PDT)
Lines: 104
Approved: news@gmane.org
Message-ID: <3657aeea-1787-40ee-9320-9b6e6466f061@isocpp.org>
References: <e59063c6-c646-4d7e-965a-6e404f17886a@isocpp.org>
 <c9b3d990-d3c3-4a26-b927-460e0c9c7461@isocpp.org>
 <2b6b016d-3463-416b-afd5-d10bac62a334@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_3672_28380956.1494354647618"
X-Trace: blaine.gmane.org 1494354648 20721 195.159.176.226 (9 May 2017 18:30:48 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 9 May 2017 18:30:48 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBWEVZDEAKGQE43WD2UA@isocpp.org Tue May 09 20:30:44 2017
Return-path: <std-proposals+bncBCEKFTV6ZUMBBWEVZDEAKGQE43WD2UA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pg0-f69.google.com ([74.125.83.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBWEVZDEAKGQE43WD2UA@isocpp.org>)
	id 1d89uF-0005IM-MI
	for gclcip-std-proposals@m.gmane.org; Tue, 09 May 2017 20:30:43 +0200
Original-Received: by mail-pg0-f69.google.com with SMTP id q125sf6114135pgq.8
        for <gclcip-std-proposals@m.gmane.org>; Tue, 09 May 2017 11:30:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to: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=aMIx2KIiIP0qrQfgHA1HUc4vZ5Eioupyxpr9dQcCxFw=;
        b=GYkhl45ZCSE2xEDDFa2Q2I3OmtR4FbQAU/rZMqgtfBsL60HkNlUi0bi+LABtpOVmsl
         Aw/Sx4On4DVATCxN89mjykvXgzf8Pyj2RtpffX0FmWIB+LzdvuXobQsc8jD8UGrrxuCC
         3OhGwh3MsiVjwDQ01hlo++/zvKCymVzbVR34GBbweg5VO0OZByYO3C9djQGAX/ug6Umy
         BV1Pj7grJPUvvzG5Ju/HoEGJ9OyCZRsSud0BLvt0JL+AzC4gmGIuBzwYOfVFlWoct+za
         LV6tHBwFBvAKSF9jQFASsVaKrcl2BSaMtj0Z89ImHd3zj2J5IMR7KjfBFbMJ9w24dQgY
         zi4g==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to: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=aMIx2KIiIP0qrQfgHA1HUc4vZ5Eioupyxpr9dQcCxFw=;
        b=aRa52HPAtEfNvkg1RkXRICRTeB+NvcRfnlTEtQwsNkbmdmHIRXjBiAfOLK7DsEUod0
         MgYIfYdlqJmmQ+T7q2ligF4PpRAkioLT0riReXqCFkShjIsXgu0PiQRO9iJld1kOJbgg
         zFKLuGOqKg1H1x9Qa3G4Es8S1FYhsemc84ii3o4Kp4lF6C5uHTwk4KrMgBHzgWWZgV8Z
         M1ENqZpV5kTKhx2PiFvWILQRuYxTHgSBNEuYzFqQsL7sdqiLPFdaZHOqRdr83QcH2Z78
         Cu9l9yTGY/cJ/NUdbR99PuElPEskzrKQWsXXfHGODhynlcif4Dyetichyn+LluOuOJdn
         3l9Q==
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: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=aMIx2KIiIP0qrQfgHA1HUc4vZ5Eioupyxpr9dQcCxFw=;
        b=H9UZg/EIJMGpUPwQbqF5eXSWpga+CYwPBAGB8mIb2zBcvvWRZlmSYv0SZ2t5LK8obp
         WwB+W2db6765sruwmtZYz0R+SZW/skmJyocHMYOVPYBuG9IO1IU+pZL2H2F0oB4XOlBX
         vWIyDIkXPPjZhid3mqU6zxIWCZN6SP2xXJ2nvfsgsqITP/CEhZP2FQScwloNtzkJMSUA
         +t1oGIPYIVNDVmhrZmMqiagTPgVQHg+A3T7aG3+ZWuBnEu3tFXZf1iJr+Vk8/ya5S5bL
         aV6lC+w75tz4edvtEUiG5c3UWIIIcJ/p8OnDreDzP6vgNOs1ggbcwv09kPLfViJXLfDR
         rsrg==
X-Gm-Message-State: AODbwcAULAHfnHGrTTQJvDg4aK08xeHijfTqdxepTV3EOwCNgr708k/0
	4eGeeIDs5/sz4w==
X-Received: by 10.98.18.81 with SMTP id a78mr654603pfj.23.1494354648929;
        Tue, 09 May 2017 11:30:48 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.11.144 with SMTP id 16ls910526oth.36.gmail; Tue, 09 May
 2017 11:30:48 -0700 (PDT)
X-Received: by 10.157.37.213 with SMTP id q79mr31123ota.11.1494354648128;
        Tue, 09 May 2017 11:30:48 -0700 (PDT)
In-Reply-To: <2b6b016d-3463-416b-afd5-d10bac62a334@isocpp.org>
X-Original-Sender: jmckesson@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <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:32371
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/32371>

------=_Part_3672_28380956.1494354647618
Content-Type: multipart/alternative; 
	boundary="----=_Part_3673_61053338.1494354647618"

------=_Part_3673_61053338.1494354647618
Content-Type: text/plain; charset="UTF-8"

On Tuesday, May 9, 2017 at 2:17:45 PM UTC-4, Denis Kotov wrote:
>
> Hi Nicol,
>
> It is very strange why it is a part of concept, for me it seems like 
> extension for templates
>

Because the Concepts TS defines the ability to constraint function 
parameters transparently:

void Func(ConceptName t);

is equivalent to:

template<ConceptName T>
void Func(T t);

`auto` is thus redefined as simply an unconstrained context.

It's not strange at all. It's a natural thing for Concepts TS to do. And 
besides, once you have concepts, you'll be using them far more than `auto` 
for function parameters. There aren't that many functions that can truly 
take *any* type. Even forwarding functions like `emplace` should constrain 
their parameters to those types which can actually be used to construct the 
object they're supposed to.

-- 
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/3657aeea-1787-40ee-9320-9b6e6466f061%40isocpp.org.

------=_Part_3673_61053338.1494354647618
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Tuesday, May 9, 2017 at 2:17:45 PM UTC-4, Denis Kotov w=
rote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8e=
x;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">Hi Nicol=
,<br><br>It is very strange why it is a part of concept, for me it seems li=
ke extension for templates</div></blockquote><div><br>Because the Concepts =
TS defines the ability to constraint function parameters transparently:<br>=
<br><div style=3D"background-color: rgb(250, 250, 250); border-color: rgb(1=
87, 187, 187); border-style: solid; border-width: 1px; overflow-wrap: break=
-word;" class=3D"prettyprint"><code class=3D"prettyprint"><div class=3D"sub=
prettyprint"><span style=3D"color: #008;" class=3D"styled-by-prettify">void=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><s=
pan style=3D"color: #606;" class=3D"styled-by-prettify">Func</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"co=
lor: #606;" class=3D"styled-by-prettify">ConceptName</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> t</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">);</span></div></code></div><br>is equiva=
lent to:<br><br><div style=3D"background-color: rgb(250, 250, 250); border-=
color: rgb(187, 187, 187); border-style: solid; border-width: 1px; overflow=
-wrap: break-word;" class=3D"prettyprint"><code class=3D"prettyprint"><div =
class=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-by-pr=
ettify">template</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">&lt;</span><span style=3D"color: #606;" class=3D"styled-by-prettify">=
ConceptName</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> T</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><s=
pan style=3D"color: #008;" class=3D"styled-by-prettify">void</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"co=
lor: #606;" class=3D"styled-by-prettify">Func</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">T t</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">);</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br></span></div></code></div><br>`auto` is thus redefined as si=
mply an unconstrained context.<br><br>It&#39;s not strange at all. It&#39;s=
 a natural thing for Concepts TS to do. And besides, once you have concepts=
, you&#39;ll be using them far more than `auto` for function parameters. Th=
ere aren&#39;t that many functions that can truly take <i>any</i> type. Eve=
n forwarding functions like `emplace` should constrain their parameters to =
those types which can actually be used to construct the object they&#39;re =
supposed to.<br></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/3657aeea-1787-40ee-9320-9b6e6466f061%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/3657aeea-1787-40ee-9320-9b6e6466f061=
%40isocpp.org</a>.<br />

------=_Part_3673_61053338.1494354647618--

------=_Part_3672_28380956.1494354647618--

.
