Re: optimierender vorschlag ?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




Hallo Johann !

Eine Optimierung wäre
class CLabelObj
{
const CRect& GetRect() const { return m_rect; }
CRect m_rect;
}
und
register const CRect& rc1((*it1)->GetRect());

Danke für deinen Tip , stimmt das rect wird Kopiert
ich werde das auf referenzbasis oder via zeiger machen.

Oft habe ich probiert das "const" als Hinweis für den
Compiler zu verwenden, einen Vorteil konnte ich nie
dabei feststellen leider. Ich werde es jedoch nochmals
überall einsetzen. Danke also für diesen Tip!


Hallo,

Es geht nicht um das const , sondern um das CRect & <--
Also mit einer Referenz arbeiten, anstatt eine kopie anzulegen.

Jimmy
.



Relevant Pages

  • Re: #define and (brackets)
    ... coding errors. ... CRect rct; ... leads to a compiler error. ... handling tokens rather than individual characters. ...
    (microsoft.public.vc.language)
  • Re: Custom CRect Question
    ... address of the CRect. ... Since the compiler did not catch it, ... But the existence of the cast operator means you can also write ... GetClientRect is called. ...
    (microsoft.public.vc.mfc)