summaryrefslogtreecommitdiff
path: root/graphics/asymptote/pair.h
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-30 03:00:43 +0000
committerNorbert Preining <norbert@preining.info>2019-09-30 03:00:43 +0000
commitbbbe8128e7ae9d816a221377dbf5ff3969bb203b (patch)
tree0283a521760b879b30e61872f14f235645745675 /graphics/asymptote/pair.h
parent14ce8b68fe7df49e8a8891bb94c63b9a846da232 (diff)
CTAN sync 201909300300
Diffstat (limited to 'graphics/asymptote/pair.h')
-rw-r--r--graphics/asymptote/pair.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/graphics/asymptote/pair.h b/graphics/asymptote/pair.h
index 4a2ca09d68..c474600326 100644
--- a/graphics/asymptote/pair.h
+++ b/graphics/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;
};