Re: vector and for-loop

From: Kitty (No)
Date: 12/06/04


Date: Tue, 7 Dec 2004 01:14:56 +0800

I have to call this code many times. So faster method is required.

"Kitty" <No spam> 撰寫於郵件新聞:41b47947$1_1@rain.i-cable.com...
> It should be:
>
> vector<Obj> v;
> ....
> for(i=0;i<v.size();i++)
> v[i].some_data=0;
>
>
>
> "Kitty" <No spam> 撰寫於郵件新聞:41b47921$1_2@rain.i-cable.com...
>> Given the following code:
>>
>> vector<Obj> v;
>> ....
>> for(i=0;i<v.size();i++)
>> v.some_data=0;
>>
>> Is it possible to further simplify and improve the speed of the above
>> code? Thanks.
>>
>
>