Changeset 1205


Ignore:
Timestamp:
Aug 14, 2003, 10:47:47 AM (17 years ago)
Author:
pooh
Message:
  • Fixed opertator=() to handle correctly reference counter. It is illegal

to use destructors in object asignments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/runtime/rf_vector.ih

    r1197 r1205  
    8383inline const Vector& Vector::operator= (Vector const& _vector)
    8484{
    85   size_t len = get_length();
    86   size_t vlen = _vector.get_length();
    8785  if (this != &_vector) {
     86    size_t len = get_length();
     87    size_t vlen = _vector.get_length();
    8888    if (len > vlen)
    8989      this -> decrease(len-vlen);
     
    9191      if (len < vlen)
    9292        this -> expand(vlen-len);
    93 //    this->~Vector();
    94 //    new (this) Vector(_vector.get_length());
    9593    for (size_t i = 0; i < vlen; i++)
    9694      self[i] = _vector[i];
     
    9896  return self;
    9997}
    100    
     98
    10199
    102100}
Note: See TracChangeset for help on using the changeset viewer.