diff options
Diffstat (limited to 'Build/source/utils/asymptote/pair.h')
-rw-r--r-- | Build/source/utils/asymptote/pair.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/pair.h b/Build/source/utils/asymptote/pair.h index 4a2ca09d68e..c4746003265 100644 --- a/Build/source/utils/asymptote/pair.h +++ b/Build/source/utils/asymptote/pair.h @@ -16,12 +16,27 @@ #include <cassert> #include <cmath> +#include <iostream> +#include <fstream> #include "common.h" #include "angle.h" namespace camp { +class jsofstream : public std::ofstream { +public: + jsofstream() {} + jsofstream(const string& name) : std::ofstream(name.c_str()) {} + void open(const string& name) {std::ofstream::open(name.c_str());} + + template<class T> + jsofstream& operator << (const T& x) { + (std::ofstream&)(*this) << x; + return *this; + } +}; + class pair : public gc { double x; double y; @@ -207,6 +222,12 @@ public: return out; } + friend jsofstream& operator << (jsofstream& out, const pair& z) + { + out << "[" << z.x << "," << z.y << "]"; + return out; + } + friend class box; }; |