diff --git a/point.cpp b/point.cpp index ee144fce..d83c9e14 100644 --- a/point.cpp +++ b/point.cpp @@ -57,3 +57,10 @@ point::operator+= (const point &rhs) { return *this; } + + +std::ostream& +operator<< (std::ostream &os, const point &p) { + os << "point(" << p.x << ", " << p.y << ", " << p.z << ")"; + return os; +} diff --git a/point.hpp b/point.hpp index 1dcaee19..67ea8b53 100644 --- a/point.hpp +++ b/point.hpp @@ -20,6 +20,8 @@ #ifndef __UTIL_POINT_HPP #define __UTIL_POINT_HPP +#include + namespace util { /// A three dimensional position in space. struct point { @@ -34,5 +36,7 @@ namespace util { }; } +std::ostream& operator<< (std::ostream&, const util::point&); + #endif // __UTIL_POINT_HPP