diff options
author | Dejan Jovanović <dejan.jovanovic@gmail.com> | 2010-02-28 00:57:25 +0000 |
---|---|---|
committer | Dejan Jovanović <dejan.jovanovic@gmail.com> | 2010-02-28 00:57:25 +0000 |
commit | 5a9b381769557608fa0183a166a26b73305703ef (patch) | |
tree | a92f96800a18d8e31d3163aeddfc270d42c2df79 /src/context | |
parent | da420bf5c1f2a270f072786145b717c38c720ed1 (diff) |
* 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.
Diffstat (limited to 'src/context')
-rw-r--r-- | src/context/context.h | 3 |
1 files changed, 2 insertions, 1 deletions
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; } /** |