Re: How can I use CArray efficiently?



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
.



Relevant Pages

  • Re: How can I use CArray efficiently?
    ... specification of the STL is far more rigorous about defining behavior, ... including computational complexity. ... code to augment the MFC documentation, ...
    (microsoft.public.vc.mfc)
  • Re: afxbeginthread- Thread function with non-zero input parameters URGENT
    ... As I said, there's nothing wrong with not understanding C or C++, but don't blame the MFC ... documentation for your lack of experience. ... If you know how to program in C/C++, you know how to use LPVOID. ... programming technique here. ...
    (microsoft.public.vc.mfc)
  • Re: MS/BCGSoft FeaturePack a one big [embarassing] hack and developers nightmare?
    ... They use the ribbon and some new controls. ... Regarding documentation... ... I'd agree with you on new programmers going to C# and that being the main ... reason for this sub-standard update to mfc. ...
    (microsoft.public.vc.mfc)
  • Re: MFC oder doch nicht MFC?
    ... Was passiert wenn in der DLL ein Ctring ... aber in einem DLL-Interface die STL zu empfehlen ist so ... Gleiches gilt eingeschränkt für die MFC, ...
    (microsoft.public.de.vc)
  • Re: MFC oder doch nicht MFC?
    ... Willst Du nun extern auf die MFC verzichten oder nicht? ... std::map IMHO nicht viel gemeinsam) benötige. ... >Nimm die STL, nimm die STL, nimm die STL. ...
    (microsoft.public.de.vc)

Loading