You have a few questions, so I will try to answer them one by one.
Why is the C ++ access qualifier not taken into account when redefining a virtual function?
Because access qualifiers are considered by the compiler after all overload permissions. This behavior is prescribed by the Standard.
, . cppreference:
: , .. . , .
, :
, , , -. .
. , .
?
.
, - , .
?
: "" .
: .
, CoolClass,
class CoolClass {
public:
void doCoolStuff(int coolId);
private:
void doCoolStuff(double coolValue);
};
, / . :
CoolClass cc;
cc.doCoolStuff(3.14);
- , - "" . , CoolClass::doCoolStuff(double).
, , , " " . (. ).
?
.
, : " B, A" - , " " ".
, , , ? , , .
. .
P.S.
, , . , , . . . , , .
P.P.S.... / . , , .