Re: Is CArray best for this...
- From: "David Ching" <dc@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 17 Jan 2008 11:21:14 -0800
"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
.
- Follow-Ups:
- Re: Is CArray best for this...
- From: Giovanni Dicanio
- Re: Is CArray best for this...
- From: Norbert Unterberg
- Re: Is CArray best for this...
- References:
- Is CArray best for this...
- From: GT
- Re: Is CArray best for this...
- From: AliR \(VC++ MVP\)
- Re: Is CArray best for this...
- From: GT
- Re: Is CArray best for this...
- From: AliR \(VC++ MVP\)
- Re: Is CArray best for this...
- From: GT
- Re: Is CArray best for this...
- From: AliR \(VC++ MVP\)
- Re: Is CArray best for this...
- From: AliR \(VC++ MVP\)
- Re: Is CArray best for this...
- From: GT
- Re: Is CArray best for this...
- From: David Wilkinson
- Re: Is CArray best for this...
- From: Norbert Unterberg
- Re: Is CArray best for this...
- From: David Ching
- Re: Is CArray best for this...
- From: Giovanni Dicanio
- Is CArray best for this...
- Prev by Date: Re: My Review of MFC Beta
- Next by Date: Re: Make CDateTimeCtrl to choose Month and year only?
- Previous by thread: Re: Is CArray best for this...
- Next by thread: Re: Is CArray best for this...
- Index(es):
Loading