This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: About std::vector::resize().


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]