Alice came by while you were working on Bob's point
type, watched you for a couple of minutes, and said: "You know, I've been thinking of creating a small geometry library for working with points and rectangles. I already wrote the tests for it, do you want to take it over?" In a brief moment of madness, you enthusiastically agreed.
Use Alice's code here (main.cpp
) and your solution for hw6/problem1 as a starting point. Do not modify the tests.
Remember that the same feature that allows us to define multiple identically named functions in the same scope also allows us to define multiple constructors within the same struct
. The stream output operator can have the same canonical signature we familiarized ourselves with during class ( std::ostringstream
is a subclass of std::ostream
).