Path: csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!Xl.tags.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 16 Mar 2016 01:10:13 -0500 Return-Path: Sender: std-cpp-request@vandevoorde.com Approved: austern@google.com Message-ID: Newsgroups: comp.std.c++ From: Christoph Schulz Subject: Re: C++11: Template argument deduction, partial ordering, and trailing parameter packs Organization: unknown References: Content-Type: text/plain; charset="UTF-8" X-Original-Date: Tue, 23 Feb 2016 14:17:59 +0100 X-Submission-Address: std-cpp-submit@vandevoorde.com Date: Wed, 16 Mar 2016 01:07:54 CST Lines: 41 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-ZBKqOWb5W/yBCVmb4nS9rQhr36rQr7dKj2yGGkI43ju+djQxxzPbfmqMqkI8CvFNdtV36q05mEpBvQw!G753ZrBGx62yhzKHiaf1Vd+DJGrJpDReKktDeYrdxNRNOac2DkWSClGAGEQ= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2386 X-Received-Bytes: 2498 X-Received-Body-CRC: 1222891135 Xref: csiph.com comp.std.c++:787 Hello! Christoph Schulz wrote: > Hello, > > I read §14.8.2.1, §14.8.2.4, and §14.8.2.5 multiple times but did not find > a convincing argumentation why the second of the following two function > templates is more specialized for the given argument than the first one: > [...] I just learned that clang++ (version 3.7.0) barks at the code: main.cpp:21:18: error: call to 'f' is ambiguous std::cout << f(X<1>{}) << std::endl; // selects #2 ^ main.cpp:9:5: note: candidate function [with I = 1, Ints = <>] int f(X x) { ^ main.cpp:15:5: note: candidate function [with I = 1] int f(X) { ^ 1 error generated. Perhaps my assumption that this code is ambiguous is indeed correct. Nevertheless I would like to see it confirmed by some other C++ expert(s) ;-) Best regards, -- Christoph Schulz [ comp.std.c++ is moderated. To submit articles, try posting with your ] [ newsreader. If that fails, use mailto:std-cpp-submit@vandevoorde.com ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.comeaucomputing.com/csc/faq.html ]