If I have vector<string*> *vect, or map<pair<string*, int*>, string*> *map,how to clean all (including the entire object that contains the vector / card)?(Everything (vector, map, contents, string, ints) is highlighted new)
vector<string*> *vect
map<pair<string*, int*>, string*> *map
new
Is that enough:
delete vect; delete map;
No, you have to go through vector/ map, delete and delete its elements in turn (which, as indicated in @SB, may require a recursive removal of their elements).
vector
map
( , , , , , , , , .)
, , .
.
vector<boost::shared_ptr<std::string> >* some_vector = new std::vector<boost::shared_ptr<std::string> >; some_vector->push_back(boost::shared_ptr<std::string>("Hello World !")); delete some_vector; // This will delete the contained std::string as well some_vector = NULL;
, . ( ..), , .
"" (delete).
delete
, delete , . , .
, . .
, Boost Pointer Container. , , , ( ) .
- , ( ).
, , . , - , , .
Source: https://habr.com/ru/post/1750494/More articles:Help in jquery animate () - jqueryWhy does this attempt to preload images using jQuery not work? - jqueryIOException when running Android projects in Eclipse - javaCSS layout error with submit button - htmlBackground image not showing in Firefox - htmlHow to change CSS syntax highlighting? - cssWeb application does not receive ASP namespace reference - web-applicationsSharePoint Permissions: Can a user with a Contribute change modify a list item that they have not created? - permissionsoperator << overload C ++ - c ++https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1750499/figuring-out-hosts-top-domain-with-javascript&usg=ALkJrhjA1bDpg2025AzbHqhhrPDZII4xiQAll Articles