Give point an ostream operator
This commit is contained in:
parent
8c995c22ac
commit
24e94d27fc
@ -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;
|
||||
}
|
||||
|
@ -20,6 +20,8 @@
|
||||
#ifndef __UTIL_POINT_HPP
|
||||
#define __UTIL_POINT_HPP
|
||||
|
||||
#include <iostream>
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user