🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Quick questions

#3821
From: Steve Clamage
Date: Tue, 26 Mar 1996 18:56
25 lines
1607 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: <315837ce.67891262@sqarc.sq.com>
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
References: <4j5b26$1e7a@mule1.mindspring.com> <4j7a64$l9i@engnews1.Eng.Sun.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
From: clamage@taumet.eng.sun.com (Steve Clamage)
Newsgroups: comp.std.c++
Subject: Re: Quick questions
Date: 26 Mar 1996 18:56:35 GMT
Organization: Carolian Systems, Toronto ON
Approved: clamage@eng.sun.com (comp.std.c++)
Message-ID: <315837ce.67891262@sqarc.sq.com>
References: <4j5b26$1e7a@mule1.mindspring.com> <4j7a64$l9i@engnews1.Eng.Sun.COM>
NNTP-Posting-Host: taumet.eng.sun.com
X-Mailer: Forte Agent .99d/32.182
Content-Length: 676
X-Lines: 18