220 16788 <1933231.dBSMvg3Xuh@tjmaciei-mobl4> article
Path: news.gmane.org!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals,gmane.comp.lang.c++.isocpp.general
Subject: Re: [std-discussion] An implementation of enhanced
 auto deduction and abbreviated template syntax using Clang
Date: Thu, 05 Mar 2015 17:03:38 -0800
Lines: 53
Approved: news@gmane.org
Message-ID: <1933231.dBSMvg3Xuh@tjmaciei-mobl4>
References: <CABsSThrwV0UCbrmoxoeQUskOjvF2+RX5ctpSq3dPMPxm=t6mww@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: ger.gmane.org 1425603833 2774 80.91.229.3 (6 Mar 2015 01:03:53 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 6 Mar 2015 01:03:53 +0000 (UTC)
Cc: Faisal Vali <faisalv@gmail.com>, std-proposals@isocpp.org
To: std-discussion@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRB3XZ4OTQKGQEKAB7U7A@isocpp.org Fri Mar 06 02:03:45 2015
Return-path: <std-proposals+bncBCB4TK757YBRB3XZ4OTQKGQEKAB7U7A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pd0-f197.google.com ([209.85.192.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCB4TK757YBRB3XZ4OTQKGQEKAB7U7A@isocpp.org>)
	id 1YTgg3-0005Q3-Pl
	for gclcip-std-proposals@m.gmane.org; Fri, 06 Mar 2015 02:03:43 +0100
Original-Received: by pdbnh10 with SMTP id nh10sf113588674pdb.2
        for <gclcip-std-proposals@m.gmane.org>; Thu, 05 Mar 2015 17:03:42 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent
         :in-reply-to:references:mime-version: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=aRdA1w4runkG2oZgy1WDb6+8Zp7hsH9m8eIFQ5JAC6Y=;
        b=lM0yqL199QWsjOhmKm77uOSRzKIYYXJ9eXEIBZvmd38tYoP99ajr9t27XsQoAvBBd0
         kSv+RxM+2Iw2jdn92ZrXX1oMuliYFVh4Uj/8uALEzzxDDzpjkynr6MQ/GfKAU6h0tXeS
         TDn+QlHs6o7q6pDO3t4bzZZeT5TrLAI3BKJYWTdsTYKHfwMCJKo1AcmEASnUNuCRB1c3
         6LxQLZmqw8/+ntS5BaGDPOP/7EIFw/qITenfzAD0lEzIMUSK8+oR8yfsV8n9tplLBkT3
         Z63S+Vj4lM7qU1TV/BWwWOI73R1aRvGELWHcGk1/rz2jp/uKuUyzHjT9yqqMMH/hoA67
         nyGA==
X-Gm-Message-State: ALoCoQkT2g1c5TcNEy4ESOIyzQejl/K8DDFdOtTuc+LOgemACufMvOThCzvSeqN6ULdzYuVItdIB
X-Received: by 10.66.194.234 with SMTP id hz10mr12064407pac.18.1425603822876;
        Thu, 05 Mar 2015 17:03:42 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.39.17 with SMTP id u17ls101005qgu.3.gmail; Thu, 05 Mar
 2015 17:03:41 -0800 (PST)
X-Received: by 10.140.21.75 with SMTP id 69mr15554535qgk.13.1425603821962;
        Thu, 05 Mar 2015 17:03:41 -0800 (PST)
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [2a01:4f8:d13:f81:21c:14ff:fe01:12a3])
        by mx.google.com with ESMTP id f31si7625468qge.11.2015.03.05.17.03.41;
        Thu, 05 Mar 2015 17:03:41 -0800 (PST)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3 as permitted sender) client-ip=2a01:4f8:d13:f81:21c:14ff:fe01:12a3;
Original-Received: from tjmaciei-mobl4.localnet (jfdmzpr02-ext.jf.intel.com [134.134.137.71])
	by gondolin.macieira.info (Postfix) with ESMTPSA id BBE4811B86E;
	Thu,  5 Mar 2015 17:03:40 -0800 (PST)
User-Agent: KMail/4.14.4 (Linux/3.11.10-25-desktop; KDE/4.14.4; x86_64; ; )
In-Reply-To: <CABsSThrwV0UCbrmoxoeQUskOjvF2+RX5ctpSq3dPMPxm=t6mww@mail.gmail.com>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3
 as permitted sender) smtp.mail=thiago@macieira.org
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:16788 gmane.comp.lang.c++.isocpp.general:4994
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/16788>

On Tuesday 03 March 2015 20:39:47 Faisal Vali wrote:
> 1) Enhanced-Auto Deduction:
> 
>  pair<auto...> f() { return make_pair([] { }, [] { }); }
>  vector<auto> v = vector<int>();

What's the value of this syntax? Is it only to make it a compiler error if the 
RHS isn't the type I had on the left?

That is, is it to make the following a compilation error:

	std::vector<auto> v = someFunction();

if someFunction() returned QVector<int> instead of std::vector<int>?

Or is this syntax going to deduce the template parameters for the LHS from the 
template parameters from the RHS, then convert? In other words, is the 
following meant to be allowed?

template <typename T> struct S1 {};
template <typename T> struct S2
{
	S2() = default;
	S2(X<T>) {}
};

S1<int> someFunction();

....
	S2<auto> v = someFunction();
	// v is S2<int>

If that is the case, what are the rules for when the RHS has more template 
parameters than the LHS? Just silently drop? (example: converting from 
std::vector<T, Allocator> to QVector<T>).

And if the LHS has more parameters but those have default values, will it also 
be allowed (from QVector<T> to std::vector<T, Allocator = allocator<T>>)?

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

-- 

--- 
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/.

.
