Make Array types uncopyable-unassignable
Finally! Catches hard-to-find errors like this:
- const SortedArrayOf<SVGDocumentIndexEntry> docs = this+svgDocEntries;
+ const SortedArrayOf<SVGDocumentIndexEntry> &docs = this+svgDocEntries;
We implement this for our array types. This, in turn, trickles down
into all types that embed the arrays. So, as long as we define all
open-ended structs in terms of Array types (all can be done using
UnsizedArrayOf), this achieves the goal of making uncopyable all
structs that are variable-sized. Yay!
diff --git a/src/hb.hh b/src/hb.hh
index ea47429..e5bec50 100644
--- a/src/hb.hh
+++ b/src/hb.hh
@@ -366,6 +366,12 @@
#define HB_DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
void operator=(const TypeName&)
+#define HB_DISALLOW_COPY_AND_ASSIGN_TEMPLATE(TypeName, T) \
+ TypeName(const TypeName<T>&); \
+ void operator=(const TypeName<T>&)
+#define HB_DISALLOW_COPY_AND_ASSIGN_TEMPLATE2(TypeName, T1, T2) \
+ TypeName(const TypeName<T1, T2>&); \
+ void operator=(const TypeName<T1, T2>&)
/*