🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #3824

Re: Quick questions

#3824
From: Steve Willer
Date: Wed, 27 Mar 1996 03:10
23 lines
1762 bytes
clamage@Eng.sun.com (Steve Clamage) wrote:

>>2) From a previous post on this group, it looks like the standard will
>>allow one to define conversion operators for pre-existing, source code
>>untouchable data types.  Yes? No? What will this look like? I have the
>>May copy of the WP, and don't see any mention of this.
>
>I'm not sure I understand what you are asking. If you mean can you define
>a conversion operator from a user-defined class to a predefined type
>like int or double, then yes, that has long been part of C++.

I believe he was referring to something like

class myclass{};
operator int(const myclass &arg);

Just like the global equality operators, etc.
---
[ 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         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
Technical Details
Message-ID: <m0u1ddY-000Cb3C@sqarc.sq.com>
Path: arc1-ca.pugleaf.net!cs.mu.OZ.AU!bounce-back
References: <4j5b26$1e7a@mule1.mindspring.com> <4j7a64$l9i@engnews1.Eng.Sun.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!cs.mu.OZ.AU!bounce-back
From: willer@carolian.com (Steve Willer)
Newsgroups: comp.std.c++
Subject: Re: Quick questions
Date: 27 Mar 96 03:10:04 GMT
Organization: Carolian Systems, Toronto ON
Approved: fjh@cs.mu.oz.au
Message-ID: <m0u1ddY-000Cb3C@sqarc.sq.com>
References: <4j5b26$1e7a@mule1.mindspring.com> <4j7a64$l9i@engnews1.Eng.Sun.COM>
NNTP-Posting-Host: munta.cs.mu.oz.au
X-Original-Date:   Tue, 26 Mar 96 13:38 EST
X-Newsreader: Forte Agent .99d/32.182
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBFAgUBMVixn+EDnX0m9pzZAQGJ4wF7B29IxpjgSWLlj3hII2+mZ60GTMfxICUE
 XV2g5Aws3G8toDmDtzKrXYeUHHUiGDnV
 =R8qL
Originator: fjh@munta.cs.mu.OZ.AU