diff options
author | Tim King <taking@cs.nyu.edu> | 2010-02-25 01:05:40 +0000 |
---|---|---|
committer | Tim King <taking@cs.nyu.edu> | 2010-02-25 01:05:40 +0000 |
commit | f716b67e7bedd90c4dd43617158c0f55c1811334 (patch) | |
tree | a0a6755d1ebad6ddebbdf96d9bcc05d591fba72a /src/expr | |
parent | ff9bda51dfb047af2005f464847edd61314bb50c (diff) |
Created basic node builder and kind tests. Also fixed a couple of node builder problems.
Diffstat (limited to 'src/expr')
-rw-r--r-- | src/expr/node_builder.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/expr/node_builder.h b/src/expr/node_builder.h index d79d5ad54..cd34c415b 100644 --- a/src/expr/node_builder.h +++ b/src/expr/node_builder.h @@ -214,6 +214,7 @@ public: operator Node(); inline void toStream(std::ostream& out) const { + Assert(!d_used, "NodeBuilder is one-shot only; tried to access it after conversion"); d_nv->toStream(out); } @@ -448,9 +449,9 @@ inline NodeBuilder<nchild_thresh>::NodeBuilder(const NodeBuilder<N>& nb) : if(nb.d_nv->d_nchildren > nchild_thresh) { realloc(nb.d_size, false); - std::copy(nb.d_nv->ev_begin(), nb.d_nv->ev_end(), d_nv->nv_begin()); + std::copy(nb.d_nv->nv_begin(), nb.d_nv->nv_end(), d_nv->nv_begin()); } else { - std::copy(nb.d_nv->ev_begin(), nb.d_nv->ev_end(), d_inlineNv.nv_begin()); + std::copy(nb.d_nv->nv_begin(), nb.d_nv->nv_end(), d_inlineNv.nv_begin()); } d_nv->d_kind = nb.d_nv->d_kind; d_nv->d_nchildren = nb.d_nv->d_nchildren; @@ -648,6 +649,7 @@ NodeBuilder<nchild_thresh>::operator Node() {// not const template <unsigned nchild_thresh> inline std::ostream& operator<<(std::ostream& out, const NodeBuilder<nchild_thresh>& b) { + b.toStream(out); return out; } |