Forumet - eeeeegj

eeeeegj

129 0 20

Spana också in:

~MinX() {delete []_v;}
MinX & operator=(MinX x)
{ delete []_v;
_l=x._l;
_nr=x._nr;
_v= new int[_l];
for(int j=0;j<_l;j++)
_v[j]=x._v[j];
return *this;
}
int & operator[](int i){return _v[i ];}
int lenght(){return _l;}
private:
int * _v;
int _l;
int _nr;
};

template<class X>
X& SmartPtr<X>::operator*()
{ if (_px==0)
throw "Fel";
return *_px;
}
template<class X>
X* SmartPtr<X>::operator->()
{if (_px==0)
throw "Fel";
return _px;
}