220 16801 <54F930C8.30609@coverity.com> article
Path: news.gmane.org!not-for-mail
From: Tom Honermann <thonermann@coverity.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals,gmane.comp.lang.c++.isocpp.general
Subject: Re: Re: [c++std-core-27216] Re: An implementation of
 enhanced auto deduction and abbreviated template syntax using Clang
Date: Thu, 5 Mar 2015 23:44:56 -0500
Lines: 55
Approved: news@gmane.org
Message-ID: <54F930C8.30609@coverity.com>
References: <CABsSThrwV0UCbrmoxoeQUskOjvF2+RX5ctpSq3dPMPxm=t6mww@mail.gmail.com> <e0666226-5ebe-462b-9803-b70bd11b9491@isocpp.org> <BLUPR03MB455C81E71E81F839F9326C9B81C0@BLUPR03MB455.namprd03.prod.outlook.com> <CAGL0aWfGy3JmORCtovX53ogZpgtBdtFb0zgNg7ZYDNixQ-Nx_w@mail.gmail.com> <CAFVAEf1+-_Ydmu9hjrJB29g+SsPifxHaDjgNGot3gVwQNoj-=A@mail.gmail.com> <54F91983.2020808@stroustrup.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
X-Trace: ger.gmane.org 1425617118 831 80.91.229.3 (6 Mar 2015 04:45:18 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 6 Mar 2015 04:45:18 +0000 (UTC)
Cc: "std-discussion@isocpp.org" <std-discussion@isocpp.org>,
	"faisalv@gmail.com" <faisalv@gmail.com>
To: <std-proposals@isocpp.org>, <c++std-core@accu.org>
Original-X-From: std-proposals+bncBDBNXSHG6UDBBUXB4STQKGQELVXDX3I@isocpp.org Fri Mar 06 05:45:10 2015
Return-path: <std-proposals+bncBDBNXSHG6UDBBUXB4STQKGQELVXDX3I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vc0-f198.google.com ([209.85.220.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDBNXSHG6UDBBUXB4STQKGQELVXDX3I@isocpp.org>)
	id 1YTk8K-0005xo-D5
	for gclcip-std-proposals@m.gmane.org; Fri, 06 Mar 2015 05:45:08 +0100
Original-Received: by mail-vc0-f198.google.com with SMTP id hq11sf19399265vcb.1
        for <gclcip-std-proposals@m.gmane.org>; Thu, 05 Mar 2015 20:45:07 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to
         :cc:subject:references:in-reply-to:content-type: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=T+JVZcUdvziRQdxuqSuxFHLAQ1q0ph4AbEyvLgLxDTA=;
        b=myQhJVQAxUcFFCJ6llzTudJi7MNMZOvHshpYkEwdaU8ciPqNQwFO3qGfl6Y7Jzhb9f
         b9EoQlQ3pJb7wUemCM4EgSCIuXQTQbRv8TS1Fv5tr0fgku6bPAvR9Sv3OSUX1R5NO63F
         +4SIi0i2fV6GscS88W8/jPgdCM5XDUQ96zgF9ZtHMvBm7mouITp8vVd2y0qkdxOJXnA5
         jMGRwg7dF28w+Hl+/Tc1TiYS7ukhar/n4QueLRYru5/8Va/bEeh5/i85GCXVBBmIHo5v
         O9YaoxtnsQcHn0QukYLHeuwlwy1softn0VCZnkj/Tu3w6fpjWJcq7gb8cg8fxBxd94js
         VkFQ==
X-Gm-Message-State: ALoCoQmtpPddKqijvRN+oiFfiyH0RdUyBn+1Vm5E6f07c0x1FajMauxh1j5NFqzORbvtxxz28a62
X-Received: by 10.236.223.166 with SMTP id v36mr12749700yhp.45.1425617107395;
        Thu, 05 Mar 2015 20:45:07 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.65.33 with SMTP id u1ls54208igs.30.canary; Thu, 05 Mar 2015
 20:45:05 -0800 (PST)
X-Received: by 10.70.98.197 with SMTP id ek5mr22348834pdb.104.1425617105881;
        Thu, 05 Mar 2015 20:45:05 -0800 (PST)
Original-Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0133.outbound.protection.outlook.com. [207.46.100.133])
        by mx.google.com with ESMTPS id hc6si12770167pbc.21.2015.03.05.20.45.05
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
        Thu, 05 Mar 2015 20:45:05 -0800 (PST)
Received-SPF: pass (google.com: domain of thonermann@coverity.com designates 207.46.100.133 as permitted sender) client-ip=207.46.100.133;
Original-Received: from [192.168.1.13] (173.53.22.182) by
 BY2PR05MB711.namprd05.prod.outlook.com (10.141.222.149) with Microsoft SMTP
 Server (TLS) id 15.1.106.15; Fri, 6 Mar 2015 04:45:03 +0000
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0
In-Reply-To: <54F91983.2020808@stroustrup.com>
X-Originating-IP: [173.53.22.182]
X-ClientProxiedBy: BL2PR01CA0049.prod.exchangelabs.com (10.141.66.49) To
 BY2PR05MB711.namprd05.prod.outlook.com (10.141.222.149)
X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR05MB711;
X-Forefront-Antispam-Report: BMV:1;SFV:NSPM;SFS:(10019020)(6049001)(6009001)(24454002)(377454003)(479174004)(36756003)(50466002)(66066001)(47776003)(65806001)(42186005)(2950100001)(122386002)(40100003)(50986999)(77156002)(62966003)(23676002)(83506001)(561944003)(76176999)(46102003)(230783001)(65816999)(92566002)(54356999)(87976001)(33656002)(117156001)(77096005)(86362001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR05MB711;H:[192.168.1.13];FPR:;SPF:None;MLV:sfv;LANG:en;
X-Microsoft-Antispam-PRVS: <BY2PR05MB711F2216689C5EFB74CE923BA1C0@BY2PR05MB711.namprd05.prod.outlook.com>
X-Exchange-Antispam-Report-Test: UriScan:;
X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5002007)(5005006);SRVR:BY2PR05MB711;BCL:0;PCL:0;RULEID:;SRVR:BY2PR05MB711;
X-Forefront-PRVS: 05079D8470
X-OriginatorOrg: coverity.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2015 04:45:03.9929 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR05MB711
X-Original-Sender: thonermann@coverity.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thonermann@coverity.com designates 207.46.100.133 as permitted
 sender) smtp.mail=thonermann@coverity.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: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://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>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:16801 gmane.comp.lang.c++.isocpp.general:5006
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/16801>

On 03/05/2015 10:05 PM, Bjarne Stroustrup wrote:
> (1) people always ask for heavier syntax from new features
> (2) people learn
> (3) people always complain that the syntax they insisted on is too heavy
> handed

I think there is truth in that.  However, I think some other languages 
have demonstrated the opposite problem.  For example, Perl has been 
criticized (fairly or not, I'm not judging) for allowing overly terse 
syntax and sometimes termed a "write-only language" due to a common 
perception that maintaining Perl code is difficult as a result.  I'm not 
trying to defend that argument here, just pointing out that the 
perception exists.

I think the abbreviated syntax goes too far as currently proposed.  It 
is hard to imagine a more terse syntax that doesn't require dropping 
type placeholders completely.  I stated elsewhere in this thread that I 
don't mind the current, rather heavy, template syntax, but that doesn't 
mean that I wouldn't appreciate a lighter syntax.  If there were not 
significant semantic differences between template function definitions 
and non-template function definitions, then I would love the abbreviated 
syntax.  The fact is though, that there are significant semantic 
differences and some of them are quite subtle.

I don't feel concerned about point of usage of functions declared with 
the abbreviated syntax.  The behavioral differences aren't that great in 
that case.  My concern is with maintenance of functions declared with 
this syntax and maintainers not realizing that a template is being 
modified.  Richard supplied an excellent list a few emails back 
illustrating some of the problems one can encounter switching a simple 
traditionally declared template function to an abbreviated one.  I think 
his insights should not be overlooked here (or, anywhere else, really).

I would be quite happy with the smallest addition to the proposal that 
makes it clear that "this is a template function" and that doesn't rely 
on my ability to scan for 'auto' or identify the name of a concept in 
the parameter list.

We have this for lambdas:
   auto l = [](auto x) { return x; }
If we could do (something like) these for generic functions, I would be 
thrilled:
   auto <>f(auto x) { return x; }
   auto <>f(Iterator i) { return i; }

Tom.

-- 

--- 
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.
