From 8915476734808811757
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,b43d17d27e7171b0
X-Google-Attributes: gidf78e5,public
From: vaps4bm@prism.gatech.edu (Brian McNamara!)
Subject: Re: explicit operator T()
Date: 2000/12/06
Message-ID: <90m70n$ebt$1@news-int.gatech.edu>#1/1
X-Deja-AN: 701894944
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
References: <3A2D10EE.35544D0A@aixigo.de> <3a2d965b.14703165@news.csrlink.net>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Trace: mail2news.demon.co.uk 976135007 mail2news:11476 mail2news mail2news.demon.co.uk
Organization: Georgia Institute of Technology
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
NNTP-Posting-Date: 6 Dec 2000 20:19:35 GMT
Newsgroups: comp.std.c++

jpotter@falcon.lhup.edu (John Potter) once said:
>On Tue,  5 Dec 2000 19:13:54 GMT, Daniel Frey <d.frey@aixigo.de> wrote:
>> sorry if this was suggested / discussed before, but would it make sense
>> to allow declaring a cast-operator as 'explicit'?

>There is quite a history available on deja for this.  The basic result.
>   explicit operator int () const;
>is spelled
>   int as_int () const;
>or whatever other naming convention you may like.

...thus making it impossible to write template code that does explicit
conversions.

For genericity's sake, cast-operators should be able to be "explicit",
just like constructors.

-- 
Brian McNamara

---
[ 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                ]
[ Note that the FAQ URL has changed!  Please update your bookmarks.     ]




