Delete auto pointer from QMultiMap
HI all
My problem is that in side QMultiMAp i ve passed auto ionter like below.
QMultiMap<qint32, IAutoPtr>::iterator iter = NULL;
while im trying to delete the IAutoPtr like
delete iter.value(); its showing error "argument given to `delete', expected pointer"
IautoPtr is an auto pointer.
Can any body help me?
Thank you all.
Re: Delete auto pointer from QMultiMap
Which auto pointer class do you use? Is it std::auto_ptr?
Re: Delete auto pointer from QMultiMap
Quote:
Originally Posted by
jacek
Which auto pointer class do you use? Is it std::auto_ptr?
ya its std::auto_ptr
Re: Delete auto pointer from QMultiMap
Quote:
Originally Posted by
phillip_Qt
ya its std::auto_ptr
auto_ptr inside container classes:
Quote:
Never ever use a container of auto_ptr objects. The standard says that "undefined" behavior is the result, but it is guaranteed to be messy.
Re: Delete auto pointer from QMultiMap
What is the reason of using an auto pointer in the map?
Re: Delete auto pointer from QMultiMap