The virtual keyword marks a member function for inheritance-based polymorphism. A derived function can replace base behavior, but a typo such as aria() creates a new method while compilation still succeeds. section 2.3
A compiling mistake
Shape defines virtual double area() const, but Square defines double aria() const. Calls through Shape* therefore use the base implementation instead of calculating the square's area. Writing double area() const override makes the compiler reject the mismatch.
A polymorphic base also needs a virtual destructor. Deleting a derived object through a base pointer otherwise destroys only the base portion, potentially leaking derived resources. section 8.8
