Move point to the util namespace

This commit is contained in:
Danny Robson 2011-08-15 20:11:20 +10:00
parent 712cd39625
commit 6e73c22d91
2 changed files with 10 additions and 7 deletions

View File

@ -22,6 +22,7 @@
#include <cmath> #include <cmath>
using namespace std; using namespace std;
using namespace util;
point::point (double _x, double _y): point::point (double _x, double _y):

View File

@ -20,15 +20,17 @@
#ifndef __UTIL_POINT_HPP #ifndef __UTIL_POINT_HPP
#define __UTIL_POINT_HPP #define __UTIL_POINT_HPP
/// A two dimensional position in space namespace util {
struct point { /// A two dimensional position in space
double x, y; struct point {
double x, y;
point (double x, double y); point (double x, double y);
double distance (const point &) const; double distance (const point &) const;
double manhattan (const point &) const; double manhattan (const point &) const;
}; };
}
#endif // __UTIL_POINT_HPP #endif // __UTIL_POINT_HPP