Thread View: comp.std.c++
3 messages
3 total messages
Started by Eugene Radchenko
Wed, 17 Jan 1996 12:02
Enhanced container functionality
Author: Eugene Radchenko
Date: Wed, 17 Jan 1996 12:02
Date: Wed, 17 Jan 1996 12:02
28 lines
1914 bytes
1914 bytes
Hi!
Having used the STL for some time, I have come to greatly missing some nice
things (and eventually derived Vector<T> from vector<T>, adding them along
with persistence support).
First, it is the ability to (easily) flush the entire container
void erase() { erase(begin(), end()); }
Second, it is the 'post-factum' equivalents to some constructors
void assign(size_type n, T t = T());
void assign(const_iterator first, const_iterator last);
etc. - putting the container into the same state as the one it would have
after the respective constructor (with the possible exception of more
reserved space available).
I think these features deserve inclusion.
Bye Genie
--
--------------------------------------------------------------------
Eugene V. Radchenko Research associate, Computer Chemistry
E-mail: eugene@qsar.chem.msu.su Fax: +7-(095)939-0290
Ordinary mail: Chair of Organic Chemistry, Department of Chemistry,
Moscow State University, 119899 Moscow, Russia
***************** Disappearances are deceptive *******************
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Re: Enhanced container functionality
Author: John Max Skaller
Date: Fri, 26 Jan 1996 19:13
Date: Fri, 26 Jan 1996 19:13
30 lines
1895 bytes
1895 bytes
Eugene Radchenko wrote:
> Having used the STL for some time, I have come to greatly missing:
> First, it is the ability to (easily) flush the entire container
> void erase() { erase(begin(), end()); }
> Second, it is the 'post-factum' equivalents to some constructors
> void assign(size_type n, T t = T());
> void assign(const_iterator first, const_iterator last);
> etc. - putting the container into the same state as the one it would have
> after the respective constructor.
> I think these features deserve inclusion.
I find myself tending to agree -- so I'll look into
including these facilities in UESTL. It is too late
for non-essential significant changes to the C++ WP.
However, it is a good time to begin developing
a "de facto" standard out of user and vendor experience,
expectations, and some cool analysis.
--
John Max Skaller voice: 61-2-566-2189
81 Glebe Point Rd fax: 61-2-660-0850
GLEBE NSW 2037 web: http://www.maxtal.com.au/~skaller/
AUSTRALIA email: skaller@maxtal.com.au
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Re: Enhanced container functionality
Author: Lars Farm
Date: Mon, 29 Jan 1996 00:03
Date: Mon, 29 Jan 1996 00:03
48 lines
2361 bytes
2361 bytes
In article <3108EC3B.767@suphys.physics.su.oz.au>,
John Max Skaller <maxtal@suphys.physics.su.oz.au> wrote:
>Eugene Radchenko wrote:
>> Having used the STL for some time, I have come to greatly missing:
>
>> First, it is the ability to (easily) flush the entire container
>> void erase() { erase(begin(), end()); }
>
>> Second, it is the 'post-factum' equivalents to some constructors
>> void assign(size_type n, T t = T());
>> void assign(const_iterator first, const_iterator last);
>> etc. - putting the container into the same state as the one it would have
>> after the respective constructor.
>> I think these features deserve inclusion.
>
>I find myself tending to agree -- so I'll look into
>including these facilities in UESTL. It is too late
>for non-essential significant changes to the C++ WP.
They are already in, according to the html-september draft
found at cygnus. Except erase() is called clear(). One example:
23.2.3 Template class list [lib.list]
...
namespace std {
template <class T, class Allocator = allocator>
class list {
...
// _lib.list.cons_ construct/copy/destroy:
...
template <class InputIterator>
void assign(InputIterator first, InputIterator last);
template <class Size, class T>
void assign(Size n, const T& t = T());
...
// _lib.list.modifiers_ modifiers:
...
void clear();
--
Lars Farm, lars.farm@nts.mh.se
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads