Changes between Version 4 and Version 5 of AnalyzingBuildPerformance
- Timestamp:
- Oct 13, 2021, 11:28:33 AM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AnalyzingBuildPerformance
v4 v5 207 207 void MyClass::doFoo() { m_yourClass->doFoo(); } 208 208 }}} 209 210 ==== Avoid Private Inlines ==== 211 212 Private 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 214 Bad: 215 {{{ 216 #!c++ 217 // MyClass.h 218 class MyClass { 219 private: 220 void doFoo() { foo(); } 221 }; 222 }}} 223 224 Good: 225 {{{ 226 #!c++ 227 // MyClass.h 228 class MyClass { 229 private: 230 void doFoo(); 231 }; 232 233 // MyClass.cpp 234 #include "MyClass.h" 235 void MyClass::doFoo() { foo(); } 236 }}}