From 3263215714148263041
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,6a0e273cd04a6fa1
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-01-15 07:45:01 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: Pete Becker <petebecker@acm.org>
Newsgroups: comp.std.c++
Subject: Re: new meaning of explicit keyword
Date: Tue, 15 Jan 2002 15:44:54 GMT
Organization: Dinkumware, Ltd
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <3C443846.C1742C70@acm.org>
References: <a1hsph$p4k$1@news.tpi.pl>
	 <92ce342f.0201100428.49e3dd92@posting.google.com> <3C3DE3E6.F27385B2@acm.org>
	 <bQm%7.65$dd2.1604@nreader3.kpnqwest.net> <3C3E11E4.E454ABB0@acm.org>
	 <92ce342f.0201110304.3045ea38@posting.google.com> <3C3F961A.AFDD9708@acm.org> <l37caCEh31Q8Ew+G@robinton.ntlworld.com>
X-Trace: mail2news.demon.co.uk 1011109498 mail2news:13622 mail2news mail2news.demon.co.uk
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
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)
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Date: 15 Jan 2002 14:09:30 GMT
X-Accept-Language:  en
Lines: 43
Xref: archiver1.google.com comp.std.c++:9057

Francis Glassborow wrote:
> 
> In article <3C3F961A.AFDD9708@acm.org>, Pete Becker <petebecker@acm.org>
> writes
> >A couple of people have mentioned templates as a reason for having
> >explicit conversion operators, but so far I haven't seen anyone explain
> >what this means. How do templates benefit from someone being able to say
> >"if you want this conversion you must write a cast"?
> 
> I think you have it the wrong way round.

That is, you think that the part of my message that you snipped, which
contains the argument that you are objecting to, has it the wrong way
round. I didn't make that argument, I replied to it. Regardless,
newsgroup discussions should be about the logic of the argument, not
about the person who presented it.

> There are times where we need
> conversion (via conversion operators) for templates. Conversion
> functions do not cut it because there is no uniform naming convention
> for them. OTOH I do not want to allow the compiler to use my conversion
> operator elsewhere for all the many reasons that we know that conversion
> operators are often poor design.
> 

There is no uniform naming convention for many things that we do inside
templates. The solution is to specify requirements for the types that
the template is instantiated on, such as having a conversion function
with a particular name and calling convention. If class designers choose
to require conversion operators, knowing that they provide the wrong
semantics, then they've made a mistake. There is no need to change the
language definition to "fix" this.

-- 
Pete Becker
Dinkumware, Ltd. (http://www.dinkumware.com)

---
[ 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.research.att.com/~austern/csc/faq.html                ]



