Originally Posted by
grumpy
It makes sense to overload a constructor if parameters of differing types can potentially used to create a whole object.
Let's say int makes sense to construct an object from an integral value in some circumstances, and from a string of characters in other circumstances. Generally, it would then make sense to create two constructors, one that accepts an int, and one that accepts a const char *. I've illustrated this using constructors that only accept one argument, but the principle works if you need to construct objects from multiple items of data (i.e. multiple parameters to the constructor).
I don't know whether it makes sense in your Vehicle class. In what ways does it make sense to construct a Vehicle?
I wouldn't supply a default constructor for a class, unless it makes sense to create an object based on nothing (no parameters required).
Don't read on unless you like technical pedantry. :wink: Technically, unless copy constructors (that create an object from an existing object of the same type) are disabled, all constructors are overloaded. The compiler will generate a copy constructor if the programmer doesn't, and it can. It doesn't make sense to have a copy constructor unless there is some other way to create an object to be copied - which means another overloaded constructor must exist. The only exceptions to this are if copy constructors are specifically suppressed.