cpp: use override and final keywords