[Coin-discuss] OsiPackedVector question

Laszlo Ladanyi ladanyi at us.ibm.com
Thu Sep 19 11:56:44 EDT 2002


Hi Matt, 

You are entirely right. The destructor should be public. Only the constructor
needs to be protected to forbid the creation of objects whose real type is
OsiPackedVectorBase.

I'll commit the fix in a minute to both the main and the development
branches.

--Laci

On Sat, 14 Sep 2002, Matthew Galati wrote:

> I am adding rows to an OsiSolverInterfacePtr in const blocks using
> addRows. After adding them I want to delete the memory but I get a
> compiler error since the destructor for OsiPackedVectorBase is
> protected. Should the destructor be protected if it is virtual? Should
> it not just inherit the destructor from OsiPackedVector?
> 
> 
> OsiPackedVectorBase* row_list[constsize];
> ... row_list[count] = new OsiPackedVector(row);
> 
> .......
> 
> //Compiler Error
> for(int ii=0;ii<constsize;ii++)
> ... delete row_list[ii];
> 
> //No Compiler Error
> for(int ii=0;ii<constsize;ii++)
> ... delete (OsiPackedVector*)row_list[ii];
> 
> 
> 
> Thanks,
> Matt
> 
> 
> 
> --
> Matthew Galati
> Lehigh University, Bethlehem, PA - Operations Research, M.S.
> Stetson University, Deland, FL - Mathematics, B.S.
> Office Phone: 610-758-4042
> Email: magh at lehigh.edu, magal11 at us.ibm.com
> URL: http://www.lehigh.edu/~magh/magh.html
> 
> 




More information about the Coin-discuss mailing list