提交 fe77a289 编写于 作者: K kvn

7105611: Set::print() is broken

Summary: Reimplemented class VSetI_ to restore Set::print().
Reviewed-by: never
上级 b87ed23d
......@@ -350,6 +350,21 @@ int VectorSet::hash() const
return (int)_xor;
}
//------------------------------iterate----------------------------------------
// Used by Set::print().
class VSetI_ : public SetI_ {
VectorSetI vsi;
public:
VSetI_( const VectorSet *vset, uint &elem ) : vsi(vset) { elem = vsi.elem; }
uint next(void) { ++vsi; return vsi.elem; }
int test(void) { return vsi.test(); }
};
SetI_ *VectorSet::iterate(uint &elem) const {
return new(ResourceObj::C_HEAP) VSetI_(this, elem);
}
//=============================================================================
//------------------------------next-------------------------------------------
// Find and return the next element of a vector set, or return garbage and
......
......@@ -151,7 +151,7 @@ public:
private:
SetI_ *iterate(uint&) const { ShouldNotCallThis(); return NULL; } // Removed
SetI_ *iterate(uint&) const;
};
//------------------------------Iteration--------------------------------------
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册