This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: About std::vector::resize().
- From: Dhruv Matani <dhruvbird at gmx dot net>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: 24 Jun 2004 22:42:48 +0530
- Subject: Re: About std::vector::resize().
- Organization:
- References: <200405251846.i4PIkBZP032335@mururoa.inria.fr> <40B398E0.8060903@roguewave.com> <16563.46765.978155.407649@localhost.localdomain> <40B47702.3010707@suse.de> <20040526140755.GA11472@alinoe.com> <1085583428.1286.4.camel@localhost.localdomain> <20040527003349.GA29903@alinoe.com> <1085624111.1271.4.camel@localhost.localdomain> <20040527025700.GA6365@alinoe.com> <1085762128.1463.15.camel@localhost.localdomain> <1085771564.1463.21.camel@localhost.localdomain> <40B795C6.9090508@suse.de> <1085802150.1174.18.camel@localhost.localdomain> <40B84379.6050201@suse.de> <1085852904.14086.5.camel@localhost.localdomain> <40B9A6A5.7010502@suse.de> <1086790042.3800.95.camel@localhost.localdomain> <40D6E5BF.4090203@suse.de>
On Mon, 2004-06-21 at 19:12, Paolo Carlini wrote:
> Dhruv Matani wrote:
>
> >>I see. Honestly, I will be away all the next week and will not be able
> >>to follow in detail your work 'til next week. Anyway, I first, preliminary,
> >>comment: any chances we can begin with the simple improvement sketched by
> >>Carlo? That would apply to builtin types, if I understand well, and
> >>definitely,
> >>*much* more code around would benefit from it. Seems straightforward, right?
> >>
> >>
> >Continuing from where we left off last time, I have a patch for the
> >vector that I am currently using.
> >
> >
> Can't we begin with something really simple, suited only for builtin types?
> The case of vector<vector> > etc., while interesting seems far less common
> and much more tricky to implement correctly.
There is no parch for built-in types. The optimization is applicable
only for those types that are:
1. Heavy (copy construction/assignment is expensive)
2. swap is NOT implemented in terms of assignment.
If use with types other than these, then the vector will become slower.
>
> Paolo.
--
-Dhruv Matani.
http://www.geocities.com/dhruvbird/
The price of freedom is responsibility, but it's a bargain, because
freedom is priceless. ~ Hugh Downs