הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
expression having type 'type' would lose some const-volatile qualifiers in order to call 'function'
Remarks
A variable with a specified const-volatile type can only call member functions defined with same or greater const-volatile qualifications.
Example
The following example generate C3848:
// C3848.cpp
void glbFunc1()
{
}
typedef void (* pFunc1)();
struct S3
{
operator pFunc1() // const
{
return &glbFunc1;
}
};
int main()
{
const S3 s3;
s3(); // C3848, uncomment const qualifier
}