15 Oct
2008
15 Oct
'08
2:20 a.m.
Mathias wrote:
- Why can objects be default-constructible? ... - centroid says it throws an exception if the polygon does not contain any point. But how can a polygon not contain any points!? The constructor of a polygon should force it to have at least one point.
Obviously, a default constructed polygon contains no points. Polygons have to be default constructible so that they can be elements of a std container. Objects that are not default constructible are a pain. I have to deal with a legacy polygon type that is not default constructible, so I have a very clear idea about which way I prefer and why. Luke