+MathedArray::MathedArray()
+ : bf_(1, '\0'), last_(0)
+{}
+
+
+MathedArray::~MathedArray()
+{
+ // deep destruction
+ // let's leak for a while...
+/*
+ MathedIter it;
+ it.SetData(this);
+ while (it.OK()) {
+ if (it.IsInset()) {
+ MathedInset * inset = it.GetInset();
+ delete inset;
+ }
+ it.Next();
+ }
+*/
+}
+
+
+MathedArray::MathedArray(MathedArray const & array)
+{
+ // this "implementation" is obviously wrong: MathedIter should be
+ // implemented by MathedArray (not the other way round) but I think
+ // getting the _interface_ of MathedArray right is more important right
+ // now (Andre')
+
+ // shallow copy
+ bf_ = array.bf_;
+ last_ = array.last_;
+
+ // deep copy
+ deep_copy();
+}
+
+void MathedArray::deep_copy()
+{
+ MathedIter it(this);
+ while (it.OK()) {
+ if (it.IsInset()) {
+ MathedInset * inset = it.GetInset();
+ inset = inset->Clone();
+ raw_pointer_insert(inset, it.getPos() + 1);
+ }
+ it.Next();
+ }
+}
+
+
+MathedArray & MathedArray::operator=(MathedArray const & array)
+{
+ MathedArray tmp(array);
+ swap(tmp);
+ return *this;
+}
+
+void MathedArray::clear()
+{
+ last_ = 0;
+ bf_.resize(1);
+ bf_[0] = 0;
+}
+
+void MathedArray::swap(MathedArray & array)
+{
+ if (this != &array) {
+ bf_.swap(array.bf_);
+ std::swap(last_, array.last_);
+ }
+}
+
+
+MathedArray::iterator MathedArray::begin()
+{
+ return bf_.begin();
+}
+
+
+MathedArray::iterator MathedArray::end()
+{
+ return bf_.end();
+}
+
+
+MathedArray::const_iterator MathedArray::begin() const
+{
+ return bf_.begin();
+}
+
+
+MathedArray::const_iterator MathedArray::end() const
+{
+ return bf_.end();
+}
+
+