Jump to content

  • Log In with Google      Sign In   
  • Create Account


How do I properly... dispose of a vector<>


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 SelethD   Members   -  Reputation: 368

Like
0Likes
Like

Posted 21 November 2012 - 06:45 PM

I have always used ... unsigned char* when needing to read in bytes...
however, I am using an API that requires me to use a vector.

So this is what I have in my objects .h file


std::vector<unsigned char> image;

Question is... what do I put in my destructor? Do I need to delete it, dispose it, clear it, take it to dinner and a movie? What?

Thanks.

Sponsor:

#2 Brother Bob   Moderators   -  Reputation: 7744

Like
0Likes
Like

Posted 21 November 2012 - 06:52 PM

It will delete itself. You don't have to do anything.

#3 SelethD   Members   -  Reputation: 368

Like
0Likes
Like

Posted 21 November 2012 - 06:56 PM

Thanks Brother Bob... I am set at ease.

#4 Bregma   Crossbones+   -  Reputation: 4739

Like
3Likes
Like

Posted 21 November 2012 - 09:33 PM

Do I need to delete it, dispose it, clear it, take it to dinner and a movie?

You can take it to dinner and a movie, but don't feel you have to. Like most dates, if you just ignore it completely eventually it will go away and leave you to get back to productive programming.
Stephen M. Webb
Professional Free Software Developer




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS