Topic: Enhanced container functionality
Author: John Max Skaller <maxtal@suphys.physics.su.oz.au>
Date: 1996/01/26 Raw View
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. ]
Author: lars.farm@nts.mh.se (Lars Farm)
Date: 1996/01/29 Raw View
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. ]
Author: "Eugene Radchenko" <eugene@qsar.chem.msu.su>
Date: 1996/01/17 Raw View
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. ]