(upbeat music)
- Our challenge for this chapter was to implement
non-member operators for the rational number class.
Here's my solution.
This is O6 solution dot cpp from chapter six,
of the exercise files.
And you'll notice that my public interface no longer has,
the operators as member functions of the class.
Instead the operators are down here as non-member functions,
and you notice that they
no longer have thee name of the class,
as part of the function signature,
and they each have two arguments.
Both rational object references.
And we come down here to the main.
When we go to build,
the build succeeds.
And we'll go ahead and run,
and all this operations work as expected.
This challenge gave you the opportunity to
exercise your knowledge,
and expand your understanding of how classes
and operators work.