Re: pass-by-value const is part of function type signature?
- From: "Ben Voigt" <bvoigt@xxxxxxxxxxxxx>
- Date: Fri, 13 Jan 2006 13:04:44 -0600
Where can I submit a bug report? The error message itself is sufficient
evidence of the bug.
error C2664: 'CSVForEach' : cannot convert parameter 2 from 'HRESULT
(__stdcall *)(const unsigned short)' to 'HRESULT (__stdcall *)(unsigned
short)'
Note that I tried to make a simpler test case, and if I remove the class and
make global functions VC++ behaves:
#include <windows.h>
HRESULT CSVForEach( const char* const szCSV, HRESULT (CALLBACK
*pfnUseCount)(unsigned short), HRESULT (CALLBACK *pfnDoIter)(unsigned short,
const char*, unsigned short) );
HRESULT CALLBACK ConfigureCount( const unsigned short nMSIDs )
{
return 0;
}
HRESULT CALLBACK ConfigureEach( const unsigned short iMSID, const char*
const szMSID, const unsigned short l )
{
return 0;
}
struct ReaderISS
{
static HRESULT ConfigureReaders( const char* const szMSIDList )
{
return CSVForEach( szMSIDList, &ConfigureCount, &ConfigureEach );
}
};
"Victor Bazarov" <v.Abazarov@xxxxxxxxxxxx> wrote in message
news:ug%23KsPGGGHA.3036@xxxxxxxxxxxxxxxxxxxxxxx
> Ben Voigt wrote:
>> Usually in function implementations, I make the local copy of arguments
>> const in order to have the compile check for attempts to change them.
>> This isn't reflected in the prototype -- there's no need for it to be and
>> it just confuses important things like argument names and whether the
>> object of the pointer is const.
>
> "Top-level" const qualifier of an argument is _not_ part of the function
> type. That's according to the Standard.
>
>> The GNU compiler suite handles this just fine.
> [...]
> There is always hope. You should submit a bug report.
>
>> [..]
>
> V
.
- Follow-Ups:
- Re: pass-by-value const is part of function type signature?
- From: Carl Daniel [VC++ MVP]
- Re: pass-by-value const is part of function type signature?
- References:
- pass-by-value const is part of function type signature?
- From: Ben Voigt
- Re: pass-by-value const is part of function type signature?
- From: Victor Bazarov
- pass-by-value const is part of function type signature?
- Prev by Date: Re: System::Net not found on VC 2005 Express Edition
- Next by Date: Re: Directory is a "a file system object" ?
- Previous by thread: Re: pass-by-value const is part of function type signature?
- Next by thread: Re: pass-by-value const is part of function type signature?
- Index(es):
Relevant Pages
|