//! Copy constructor for argument passing and returning a result
//! Only copies a pointer to the set.
//! Throws an error if qhsettemp_defined, otherwise have a double-free
//!\todo Convert QhullVertexSet to a shared pointer with reference counting
QhullVertexSet::
QhullVertexSet(constQhullVertexSet&other)
:QhullSet<QhullVertex>(other)
,qhsettemp_defined(false)
{
if(other.qhsettemp_defined){
throwQhullError(10077,"QhullVertexSet: Cannot use copy constructor since qhsettemp_defined (e.g., QhullVertexSet for a set and/or list of QhFacet). Contains %d vertices",other.count());
}
}//copy constructor
//! Copy assignment only copies a pointer to the set.
//! Throws an error if qhsettemp_defined, otherwise have a double-free
QhullVertexSet&QhullVertexSet::
operator=(constQhullVertexSet&other)
{
QhullSet<QhullVertex>::operator=(other);
qhsettemp_defined=false;
if(other.qhsettemp_defined){
throwQhullError(10078,"QhullVertexSet: Cannot use copy constructor since qhsettemp_defined (e.g., QhullVertexSet for a set and/or list of QhFacet). Contains %d vertices",other.count());
}
return*this;
}//assignment
voidQhullVertexSet::
freeQhSetTemp()
{
if(qhsettemp_defined){
qhsettemp_defined=false;
QH_TRY_(qh()){// no object creation -- destructors skipped on longjmp()
qh_settempfree(qh(),referenceSetT());// errors if not top of tempstack or if qhmem corrupted