- if ((other.flags & status_flags::evaluated)==0) {
- // cf. copy constructor
- const ex & tmpex = other.eval(1); // evaluate only one (top) level
- bp = tmpex.bp;
- GINAC_ASSERT(bp!=0);
- GINAC_ASSERT(bp->flags & status_flags::dynallocated);
- ++bp->refcount;
- if ((other.flags & status_flags::dynallocated)&&(other.refcount==0)) {
- delete &const_cast<basic &>(other);
- }
- } else {
- if (other.flags & status_flags::dynallocated) {
- // it's on the heap, so just copy bp:
- bp = &const_cast<basic &>(other);
- } else {
- // create a duplicate on the heap:
- bp = other.duplicate();
- bp->setflag(status_flags::dynallocated);
- }
- GINAC_ASSERT(bp!=0);
- // bp->clearflag(status_flags::evaluated);
- ++bp->refcount;
- }
- GINAC_ASSERT(bp!=0);
- GINAC_ASSERT(bp->flags & status_flags::dynallocated);
+ if ((other.flags & status_flags::evaluated)==0) {
+ // cf. copy constructor
+ const ex & tmpex = other.eval(1); // evaluate only one (top) level
+ bp = tmpex.bp;
+ GINAC_ASSERT(bp!=0);
+ GINAC_ASSERT(bp->flags & status_flags::dynallocated);
+ ++bp->refcount;
+ if ((other.flags & status_flags::dynallocated)&&(other.refcount==0)) {
+ delete &const_cast<basic &>(other);
+ }
+ } else {
+ if (other.flags & status_flags::dynallocated) {
+ // it's on the heap, so just copy bp:
+ bp = &const_cast<basic &>(other);
+ } else {
+ // create a duplicate on the heap:
+ bp = other.duplicate();
+ bp->setflag(status_flags::dynallocated);
+ }
+ GINAC_ASSERT(bp!=0);
+ // bp->clearflag(status_flags::evaluated);
+ ++bp->refcount;
+ }
+ GINAC_ASSERT(bp!=0);
+ GINAC_ASSERT(bp->flags & status_flags::dynallocated);