abraham_hilbert abraham_hilbert - 1 month ago 16
C++ Question

can a non-virtual function be equal to 0?

can a non-virtual function be equal to 0, e.g., something like

void foo() = 0


where the keyword "virtual" is not in front?

Best

Answer

No.

When applied to a virtual function, = 0 makes it pure virtual. It means nothing on a non-virtual function.

Comments