Original Post
Is there any simple way to make a class that is really another class with different constructor arguments? I guess I'ts hard to explain. Suppose I have a class Rectangle with the constructor Rectangle(double x, double y, double w, double h) And I want to do something like Rectangle myrect = Square(0,0,50); I could use inheritance like this But it seems like such a waste to create a separate class like this when all I want to do is call the constructor with some arguments pre filled in basically. And then I have to worry about adding virtual destructors etc. Is there anyway to do this without making a seperate Square class? I guess macros are a possibility, but they are really easy to mess up and make the code difficult to understand. Or am I overthinking things?
class Square: public Rectangle
{
public:
Square(double x, double y, double side): Rectangle(x,y,side,side){}
}