Re: Is CArray best for this...



"Giovanni Dicanio" <giovanni.dicanio@xxxxxxxxxxx> wrote in message
news:uG2dxrTWIHA.5980@xxxxxxxxxxxxxxxxxxxxxxx

Hi David,

I think that you are right, only if the intial size of CArray is setted
properly...

But the grow policy of CArray is not good, IIRC. In fact I think that
CArray grows using a *fixed constant*. Instead, std::vector's amount of
growth is *proportional* to the current capacity() (I think they use a
factor of 2).


Yes, the factor of 2 is an excellent algorithm, but I've not taken advantage
of it simply by setting intial size of CArray. These collection classes are
a comfort thing. They are meant to extend the base types available in a
language, and in my mind CArray is simple for an MFC programmer to use,
whereas the std::vector and other STL is clearly foreign with little attempt
made to make it attractive for a Windows programmer. Sometimes I think
Windows is the _last_ platform considered in making cross platform libraries
such as these.

So I only embrace a foreign library like STL for a clearcut advantage, and
not for things like David W. said that can be easily worked around.
Personal preference, David W... I also don't use Seamonkey! ;)

-- David


.


Loading