home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.std.c++
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!wupost!zaphod.mps.ohio-state.edu!rpi!clarkson!news.clarkson.edu!cline
- From: cline@sun.soe.clarkson.edu (Marshall Cline)
- Subject: Re: Is coercion to a reference defined?
- In-Reply-To: moudgill@cs.cornell.edu's message of Sun, 6 Sep 1992 18:29:05 GMT
- Message-ID: <CLINE.92Sep8235800@sunspot.clarkson.edu>
- Sender: news@news.clarkson.edu
- Nntp-Posting-Host: sunspot.ece.clarkson.edu
- Reply-To: cline@sun.soe.clarkson.edu (Marshall Cline)
- Organization: Paradigm Shift, Inc (C++/Reuse/OOD/OO-mgmt training)
- References: <1992Sep6.182905.6603@cs.cornell.edu>
- Date: Wed, 9 Sep 1992 04:58:00 GMT
- Lines: 18
-
- In article <1992Sep6.182905.6603@cs.cornell.edu> moudgill@cs.cornell.edu ( Mayan Moudgill) writes:
- ...
- >I'd like to define TWO functions:
- > operator T () { return _value;}
- >and
- > operator T& () { return _value;}
-
- They would, as stated, be ambiguous. However, you can make the first one
- a `const' member function, thereby disambiguating them based on the constness
- of the object being converted to a T.
-
- ++Marshall
- --
- Marshall Cline
- --
- Marshall P. Cline, Ph.D. / Paradigm Shift, Inc / 65 N Main St/Norwood, NY 13668
- cline@sun.soe.clarkson.edu / 315-353-4585 / FAX: 315-353-6100
- Maintainer, C++ FAQ
-