Article View: comp.sys.mac.programmer.codewarrior
Article #1433Re: CWP6: illegal implicit conversion...
From: meeroh
Date: Thu, 21 Sep 2000 00:00
Date: Thu, 21 Sep 2000 00:00
35 lines
1736 bytes
1736 bytes
In article <39CA60B0.DC1700A2@mindspring.com>, got@mindspring.com wrote: >Howdy All, > >I was recompiling my CPLAT sources (from Ken Stahlman) under CWP6 and >encountered several places in the code where I am now receiving this >error. (Don't worry about what a CP_Region is...suffice it to say its a >valid thing)s: > > Error: illegal implicit conversion from 'CP_Region' to 'CP_Region &' > >Here is the snippet of code that causes the error: > > OnDraw( CP_Region(fPlatformWindow->visRgn) ); > >Now, if I change the code to read like this: > > CP_Region cpr(fPlatformWindow->visRgn); > OnDraw( cpr); > >Then it compiles fine. I wonder why this is so??? In the first case the CP_Region is a temporary, and is therefore a const. In the second case it's not. If you declared the second one as const CP_Region you'd get the same error. You should probably change OnDraw to take a const CP_Region&, if it doesn't modify the region. Hth, meeroh -- To get random signatures put text files into a folder called "Random Signatures" into your Preferences folder.
Technical Details
Message-ID:
<macdev-B4B8CB.15345921092000@news.mit.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<39CA60B0.DC1700A2@mindspring.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10bcce,4a0d644260b480cb X-Google-Attributes: gid10bcce,public X-Google-Thread: f635e,4a0d644260b480cb X-Google-Attributes: gidf635e,public From: meeroh <macdev@meeroh.org> Subject: Re: CWP6: illegal implicit conversion... Date: 2000/09/21 Message-ID: <macdev-B4B8CB.15345921092000@news.mit.edu> X-Deja-AN: 672573619 References: <39CA60B0.DC1700A2@mindspring.com> Mail-Copies-To: poster X-Trace: dreaderd 969564887 9438 18.18.1.86 Organization: MIT User-Agent: MT-NewsWatcher/3.0 (PPC) Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.mac