From 5708105038164376600
X-Google-Thread: f78e5,d9fe358a73c69991
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!local01.nntp.dca.giganews.com!nntp.speakeasy.net!news.speakeasy.net.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 10 Aug 2005 00:50:10 -0500
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Delivered-To: std-c++@ucar.edu
From: "Wu Yongwei" <wuyongwei@gmail.com>
Newsgroups: comp.std.c++
Subject: Re: Should failure to instantiate a function template abort compilation during overload resolution?
Organization: http://groups.google.com
Message-ID: <1123642375.849913.19940@f14g2000cwb.googlegroups.com>
References: <1123485075.096196.242990@g44g2000cwa.googlegroups.com>
   <hinnant-6B7192.21000609082005@syrcnyrdrs-03-ge0.nyroc.rr.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Complaints-To: groups-abuse@google.com
User-Agent: G2/0.2
Complaints-To: groups-abuse@google.com
Injection-Info: f14g2000cwb.googlegroups.com; posting-host=211.152.42.2;
   posting-account=YpX4bQ0AAABQX3uC3kY4dsrVfN1inbmo
X-Virus-Scanned: amavisd-new at ucar.edu
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
Date: Wed, 10 Aug 2005 00:45:38 CST
Lines: 28
NNTP-Posting-Host: 65.182.171.162
X-Trace: sv3-9ift5LJvb/H00PIr2Q15riVbMU65FiplOr9vB5TrvYTi/F2WxNcE+UuW+LKaNvD7oHPLVHJyIvVerO9!ijtB68oHMMDyiMSuB9Tf/J3Qfrw/hX5fqpnXIg5I6FGuiJaj0lzd3oK+4CnlA00x0pdZQNNx56Kz!zjyk0JpitER2aUjz58L5L+EyEXmIRYIcazsoIa+EIw==
X-Complaints-To: abuse@speakeasy.net
X-DMCA-Complaints-To: abuse@speakeasy.net
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.32
Xref: g2news1.google.com comp.std.c++:1737

Howard Hinnant wrote:
> CodeWarrior is experimenting with an enable_if-like return type on
> std::distance so that this overload will not participate in overload
> resolution if InputIterator isn't an iterator.  Your example on our
> implementation will compile and set d == 2 at runtime.

Thanks for your informatiom.  Do you think this is the way to go?  I
mean, does anyone in the C++ committee realize that it might be a
defect in the Standard that violates the rationale of the std namespace
and can be very confusing to innocent users that happen to define their
own versions of distance(std::...)?

My current opinion is that failure to instantiate a template function
should automatically remove it from the candidates of overload
resolution.

Comments please.

Best regards,

Yongwei

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



