Skip to content

Latest commit

 

History

History
62 lines (37 loc) · 1.12 KB

CppRegister.md

File metadata and controls

62 lines (37 loc) · 1.12 KB

 

 

 

 

 

 

register is a keyword to hint the compiler that a certain variable will be heavily used. The compiler knows best, however. Consider never using register [1,2].

 


int main() {   register int x = 3; //Nearly never use register [1] }

 

 

 

 

 

 

  1. Herb Sutter. Exceptional C++ style. 2005. ISBN: 0-201-76042-8. Item 28 guideline: 'Never write register [...]'.
  2. Joint Strike Fighter Air Vehicle C++ Coding Standards for the System Development and Demonstration Program. Document Number 2RDU00001 Rev C. December 2005. AV Rule 140 (MISRA Rule 28, Revised): 'The register storage class specifier shall not be used.'