From 4541390027497041828 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,6a0e273cd04a6fa1 X-Google-Attributes: gidf78e5,public X-Google-ArrivalTime: 2002-01-16 10:23:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail From: Gabriel Dos_Reis Newsgroups: comp.std.c++ Subject: Re: new meaning of explicit keyword Date: Wed, 16 Jan 2002 18:22:15 GMT Organization: I.N.R.I.A Sophia-Antipolis (France) Approved: Fergus Henderson , moderator of comp.std.c++ Message-ID: References: <92ce342f.0201100428.49e3dd92@posting.google.com> <3C3DE3E6.F27385B2@acm.org> <3C3E11E4.E454ABB0@acm.org> <92ce342f.0201110304.3045ea38@posting.google.com> <3C3F961A.AFDD9708@acm.org> X-Trace: mail2news.demon.co.uk 1011205339 mail2news:26359 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=iso-8859-1 Content-Transfer-Encoding: 8bit X-Newsreader: Gnus v5.5/XEmacs 20.4 - "Emerald" Lines: 28 Xref: archiver1.google.com comp.std.c++:9089 Matthew Austern writes: | Pete Becker 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"? | | One motivation is writing "smart pointer" classes, e.g. the nested | pointer type for a user-defined allocator. | | There are pairs of pointer types T1 and T2 with the property that | (1) A value of type T1 can be converted to T2 with static_cast; and | (2) There is no automatic conversion from T1 to T2. I'm unclear about exactly what problem the requested feature will solve in your specific example. -- Gabriel Dos Reis, dosreis@cmla.ens-cachan.fr --- [ 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 ]