Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #8478
| From | Nobody <nobody@nowhere.com> |
|---|---|
| Subject | Re: C Containers Library vs STL |
| Date | 2011-08-04 21:40 +0100 |
| Message-Id | <pan.2011.08.04.20.40.53.379000@nowhere.com> |
| Newsgroups | comp.lang.c++ |
| References | (6 earlier) <99ubh7Far7U2@mid.individual.net> <4e3a4419$0$3116$7b1e8fa0@news.nbl.fi> <99v0n0Far7U5@mid.individual.net> <4e3aa9ba$0$2832$7b1e8fa0@news.nbl.fi> <j1ea4d$3kp$1@speranza.aioe.org> |
| Organization | Zen Internet |
On Thu, 04 Aug 2011 16:25:19 +0200, jacob navia wrote: > In the C containers library the container ALWAYS owns the memory used > by the objects/keys. This means the given buffers are always copied > when you add an item. > > What is the behavior in C++, it is different? No. But if you have a container which contains pointers, it literally contains the pointers, not the data which they point to. E.g. std::vector<char*>::push_back() will just add the supplied pointer, it won't perform a strdup() (char* doesn't necessarily imply a NUL-terminated string).
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
C Containers Library vs STL jacob navia <jacob@spamsink.net> - 2011-08-03 22:40 +0200
Re: C Containers Library vs STL Ian Collins <ian-news@hotmail.com> - 2011-08-04 09:13 +1200
Re: C Containers Library vs STL Robert Wessel <robertwessel2@yahoo.com> - 2011-08-03 17:36 -0500
Re: C Containers Library vs STL Robert Wessel <robertwessel2@yahoo.com> - 2011-08-03 17:38 -0500
Re: C Containers Library vs STL jacob navia <jacob@spamsink.net> - 2011-08-04 01:30 +0200
Re: C Containers Library vs STL Robert Wessel <robertwessel2@yahoo.com> - 2011-08-03 18:40 -0500
Re: C Containers Library vs STL jacob navia <jacob@spamsink.net> - 2011-08-04 13:42 +0200
Re: C Containers Library vs STL Ian Collins <ian-news@hotmail.com> - 2011-08-04 12:34 +1200
Re: C Containers Library vs STL Ian Collins <ian-news@hotmail.com> - 2011-08-04 13:38 +1200
Re: C Containers Library vs STL Juha Nieminen <nospam@thanks.invalid> - 2011-08-04 07:02 +0000
Re: C Containers Library vs STL Ian Collins <ian-news@hotmail.com> - 2011-08-04 19:40 +1200
Re: C Containers Library vs STL Juha Nieminen <nospam@thanks.invalid> - 2011-08-04 14:16 +0000
Re: C Containers Library vs STL jacob navia <jacob@spamsink.net> - 2011-08-04 16:25 +0200
Re: C Containers Library vs STL Nobody <nobody@nowhere.com> - 2011-08-04 21:40 +0100
Re: C Containers Library vs STL jacob navia <jacob@spamsink.net> - 2011-08-04 09:42 +0200
Re: C Containers Library vs STL Ian Collins <ian-news@hotmail.com> - 2011-08-04 19:59 +1200
Re: C Containers Library vs STL Marc <marc.glisse@gmail.com> - 2011-08-04 12:47 +0000
Re: C Containers Library vs STL jacob navia <jacob@spamsink.net> - 2011-08-04 15:17 +0200
csiph-web