From 443836540322840555
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,7eaa8faac8da5016
X-Google-Attributes: gidf78e5,public
From: dHarrison@worldnet.att.net (Doug Harrison)
Subject: Re: Defect Report: member == in container iterators considered harmful
Date: 1999/08/20
Message-ID: <37bfde27.4601484@netnews.worldnet.att.net>#1/1
X-Deja-AN: 515308600
X-NNTP-Posting-Host: 12.73.242.126
Content-Transfer-Encoding: 7bit
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <7p4nj8$n3u@enews4.newsguy.com> <37B95B96.7F37@wanadoo.fr> <37ceebde.11431046@netnews.worldnet.att.net> <37BAC024.4087@wanadoo.fr> <37caab76.16784453@netnews.worldnet.att.net>
X-UID: 0000000001
X-Status: $$$T
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: abuse@worldnet.att.net
X-Trace: bgtnsc01.worldnet.att.net 935190345 7653 12.73.242.126 (20 Aug 1999 23:05:45 GMT)
Organization: AT&T WorldNet Services
Mime-Version: 1.0
NNTP-Posting-Date: 20 Aug 1999 23:05:45 GMT
Newsgroups: comp.std.c++
Originator: clamage@taumet


Doug Harrison wrote:

>Unless I'm misunderstanding something, making the iterator a nested class of
>the deque template precludes defining operator== as a non-member, because of
>deduction problems, while you can define them as non-members if iterator is
>not a nested class.

Actually, I think I am mistaken. If you have:

template<class T>
struct A
{
   struct B
   {
      friend bool operator==(const B& x,const B& y) { ... }
   };
};

According to 14.5.3/1, this operator== is not a function template, so
template argument deduction doesn't even come into play.

-- 
Doug Harrison
dHarrison@worldnet.att.net


[ 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://reality.sgi.com/austern_mti/std-c++/faq.html              ]




