Changes between Version 4 and Version 5 of AnalyzingBuildPerformance


Ignore:
Timestamp:
Oct 13, 2021 11:28:33 AM (3 years ago)
Author:
jer.noble@apple.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AnalyzingBuildPerformance

    v4 v5  
    207207void MyClass::doFoo() { m_yourClass->doFoo(); }
    208208}}}
     209
     210==== Avoid Private Inlines ====
     211
     212Private functions, by definition, can only be called from class methods and declared friends, so defining private functions in the class header file is of limited value. If those private functions are called by friends or other inlined functions, consider moving the private function definition into an Inline.h header. Otherwise, consider moving the definition into the implementation file.
     213
     214Bad:
     215{{{
     216#!c++
     217// MyClass.h
     218class MyClass {
     219private:
     220    void doFoo() { foo(); }
     221};
     222}}}
     223
     224Good:
     225{{{
     226#!c++
     227// MyClass.h
     228class MyClass {
     229private:
     230    void doFoo();
     231};
     232
     233// MyClass.cpp
     234#include "MyClass.h"
     235void MyClass::doFoo() { foo(); }
     236}}}