Re: Works in Visual C++ 2003 but not in 2005
- From: "Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx>
- Date: Mon, 19 Dec 2005 21:13:35 -0800
John wrote:
> Hi,
>
> I am working on a C++ project which has been developed with Visual
> Studio.Net 2003. When I compile it with Visual Studio 2005, it gives
> hundred of errors. Two of the strange errors are following, which
> repeated in many places:
>
> 1-error C2664: 'action' : cannot convert parameter 1 from 'Foo *' to
> 'const Foo *&'
Comeau C++ agrees with VC++ 2005 - the code is ill-formed according to the
C++ standard.
Possible workarounds, depending on what you're doing in "action":
void action(const Foo* const & cptr);
or
void action(Foo * const & cptr);
or
void action(Foo *& cptr);
or
Foo* fPtr = new Foo();
action(const_cast<const Foo*&>(fPtr));
-cd
.
- Follow-Ups:
- Re: Works in Visual C++ 2003 but not in 2005
- From: John
- Re: Works in Visual C++ 2003 but not in 2005
- References:
- Works in Visual C++ 2003 but not in 2005
- From: John
- Works in Visual C++ 2003 but not in 2005
- Prev by Date: parser stack overflow, program too complex eroor C1026
- Next by Date: Re: parser stack overflow, program too complex eroor C1026
- Previous by thread: Works in Visual C++ 2003 but not in 2005
- Next by thread: Re: Works in Visual C++ 2003 but not in 2005
- Index(es):
Relevant Pages
|
Loading