From -6158382021918171415
X-Google-Thread: f78e5,1130da7a3640a78c
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.speakeasy.net!news.speakeasy.net.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 10 May 2006 10:10:01 -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)
X-Original-To: std-c++@mailman.ucar.edu
Delivered-To: std-c++@mailman.ucar.edu
Delivered-To: std-c++@ucar.edu
From: kuyper@wizard.net
Newsgroups: comp.std.c++
Subject: Re: Deprecate the use of plain pointers as standard container iterators
Organization: http://groups.google.com
Message-ID: <1147220245.715804.245950@y43g2000cwc.googlegroups.com>
References: <1147122934.938877.153140@g10g2000cwb.googlegroups.com>
   <memo.20060509203036.700A@brangdon.cix.compulink.co.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Complaints-To: groups-abuse@google.com
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.13) Gecko/20060418 Fedora/1.0.8-1.1.fc4 Firefox/1.0.8,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: y43g2000cwc.googlegroups.com; posting-host=66.234.255.45;
   posting-account=bPBxkgwAAABzUwlEAMy-xGlLqZFJ5Jz_
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 May 2006 10:08:17 CST
Lines: 32
NNTP-Posting-Host: 65.182.171.162
X-Trace: sv3-PaUe83eFUn/blCvEmBJVsA2mDDTrip7XiO2AnC4Oc9I4/jiZJVyOPWkJ+M69qBPpHfGgOS39+xzGULu!1wnQAnHO76Rt8QK/qLzqrJoy93+DTiKJk2uBA9GhgKMDxYtpl52x7Z+SJoGo+UE/s7Xb4uVDhP80!NoIvlO961xVi4d8taJrhoYLEYOBSWGMxjhuKuHtB95E=
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: g2news2.google.com comp.std.c++:1871

Dave Harris wrote:
.
> For me the problem is with code like:
>
>     #include <vector>
>
>     void func( std::vector<int>::iterator ) {}
>     void func( int * ) {}
>
> On some platforms this defines two functions, and on others it is an error
> because it defines the same function twice.

I agree, this is a problem, and I don't know any good general solution
to it. It can comes up in two different ways: typedefs and template
type parameters. The best solution I know of involves adding a
construct to the language which could be used to check whether or not
two types are the same, which can be used to supress one of the two
competing definitions when they are. However, even that approach has
its problems.

> Nicola Musatti's suggestion would be a better solution.

But it doesn't solve the problem, it just moves it. It just means that
you won't have the problem with int*, but you will still have it with
whichever other type std::vector<int>::iterator is a typedef for.

---
[ 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.comeaucomputing.com/csc/faq.html                      ]



