OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Cloning Exception Objects

TXBase contains a function called TXBase::Clone().

This function takes no parameters and returns a TXBase*. Clone creates a copy of the current exception object by allocating a new TXBase object with new and passing a dereferenced this pointer to the copy constructor.

TXBase*
TXBase::Clone()
{
return new TXBase(*this);
}

It is important to note that any classes derived from TXBase must override Clone to use the proper constructor. For example, the TXOwl class, which is derived from TXBase, implements the TXBase::Clone() function like this: TXOwl* TXOwl::Clone() { return new TXOwl(*this); }

See Also