I define an abstract base class called Polygon which contains a method with signature like
int operator==(Polygon other)
I get an error while compiling which says
cannot declare parameter ‘other’ to be of abstract type ‘Polygon’
This was expected as Polygon was an abstract class and can not have objects. However when I replaced 'other' with '&other' the code compiled and even gave expected results.
From other posts on stack overflow I understood that when I define a function with paremeters preceded by '&' an alias to the passed argument is created. Now I have a variable called 'other' of type 'Polygon', which is not just a pointer. How can this happen as Polygon is an ABC? Is such code valid from a standards point of view?