Re: How can I use CArray efficiently?
- From: "Doug Harrison [MVP]" <dsh@xxxxxxxx>
- Date: Mon, 09 Apr 2007 20:38:34 -0500
On Mon, 09 Apr 2007 19:32:21 -0400, Joseph M. Newcomer
<newcomer@xxxxxxxxxxxx> wrote:
Yes, the issues are essentially the same; key here is that std::vector seems to have
handled them differently.
Not "seems to"; HAS.
The exponential growth policy is one of the crucial performance
hacks.
It's the most obvious way to satisfy the std::vector REQUIREMENT that
insertions at the end take amortized constant time.
One of the big advantages of the STL over MFC is that the C++ Standard
specification of the STL is far more rigorous about defining behavior,
including computational complexity. To this day, MFC remains much more of a
"fill in the blank" library, and I regularly have to consult the source
code to augment the MFC documentation, sometimes to answer very simple
questions such as a class's ownership policy for an object it manages. This
is of course bad, and it requires some judgment to distinguish between info
that's likely to remain reliable in the future (e.g. a documentation
omission) and that which may change (e.g. unspecified behavior that isn't
strongly implied by what is documented).
--
Doug Harrison
Visual C++ MVP
.
- Follow-Ups:
- Re: How can I use CArray efficiently?
- From: Joseph M . Newcomer
- Re: How can I use CArray efficiently?
- References:
- How can I use CArray efficiently?
- From: fiveight
- Re: How can I use CArray efficiently?
- From: MrAsm
- Re: How can I use CArray efficiently?
- From: Joseph M . Newcomer
- Re: How can I use CArray efficiently?
- From: Doug Harrison [MVP]
- Re: How can I use CArray efficiently?
- From: Joseph M . Newcomer
- How can I use CArray efficiently?
- Prev by Date: Re: Are _T() and TEXT() macros equivalent?
- Next by Date: Re: How many bytes per Italian character?
- Previous by thread: Re: How can I use CArray efficiently?
- Next by thread: Re: How can I use CArray efficiently?
- Index(es):
Relevant Pages
|
Loading