summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/pair.h
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-10-06 17:17:34 +0000
committerKarl Berry <karl@freefriends.org>2019-10-06 17:17:34 +0000
commit7f9f7dad00ea5f025578c491005835740f9ffd90 (patch)
tree011a87a78042a82ea3a18f5c08e60f6a3930bf0b /Build/source/utils/asymptote/pair.h
parent37d8fb68e502daabe6aa5f5ae9fb78191f275742 (diff)
asy 2.56 sources
git-svn-id: svn://tug.org/texlive/trunk@52300 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/pair.h')
-rw-r--r--Build/source/utils/asymptote/pair.h21
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;
};