A
axel22
Hello.
Please take a look at this piece of code:
class baseC {
//...
};
class derivedC : baseC {
//...
};
int main() {
baseC b1;
derivedC d1;
std::vector<baseC*> vex;
vex.push_back(&b1);
vex.push_back(&d1);
return 1;
}
Compiler returns an error on the second push_back - type cast:
conversion from 'derivedC * __w64' to 'baseC * const' exists, but is
inaccessible.
Can anyone tell me how to do this without the explicit cast, such as
(baseC *)(&d1);
thnx.
Please take a look at this piece of code:
class baseC {
//...
};
class derivedC : baseC {
//...
};
int main() {
baseC b1;
derivedC d1;
std::vector<baseC*> vex;
vex.push_back(&b1);
vex.push_back(&d1);
return 1;
}
Compiler returns an error on the second push_back - type cast:
conversion from 'derivedC * __w64' to 'baseC * const' exists, but is
inaccessible.
Can anyone tell me how to do this without the explicit cast, such as
(baseC *)(&d1);
thnx.