From 5a9b381769557608fa0183a166a26b73305703ef Mon Sep 17 00:00:00 2001 From: Dejan Jovanović Date: Sun, 28 Feb 2010 00:57:25 +0000 Subject: * context.h - Changed cdlist::push_back to use a new copy constructor instead of the assignment operator. This is important as Nodes, for example, check that d_nv != NULL in the assignemnt operator. * node.h - Simplified the constructors, apparently it's ok to write ~ref_count in the template declaration. All the constructed nodes are now the ref-counted ones, i.e. eqNode() will return a ref-counted node. --- src/context/context.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/context/context.h') diff --git a/src/context/context.h b/src/context/context.h index 6462cccaa..6a35945b7 100644 --- a/src/context/context.h +++ b/src/context/context.h @@ -707,7 +707,8 @@ public: void push_back(const T& data) { makeCurrent(); if (d_size == d_sizeAlloc) grow(); - d_list[d_size++] = data; + ::new((void*)(d_list + d_size)) T(data); + ++ d_size; } /** -- cgit v1.2.3