Changes between Version 15 and Version 16 of code/C++_styleguide
- Timestamp:
- Sep 4, 2008, 7:09:56 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
code/C++_styleguide
v15 v16 103 103 Names representing types must be in mixed case (CamelCase) starting with upper case. 104 104 {{{ 105 class SavingsAccount { 106 }; 107 108 struct SimpleStruct { 105 class SavingsAccount 106 { 107 }; 108 109 struct SimpleStruct 110 { 109 111 }; 110 112 }}} … … 118 120 Memeber variables of classes all end with an underline: 119 121 {{{ 120 class TestClass {121 122 class TestClass 123 { 122 124 private: 123 int numberOfTimes_;125 int numberOfTimes_; 124 126 }; 125 127 }}} 126 128 Static variables of classes have to end with '_s': 127 129 {{{ 128 class TestClass2 {129 130 class TestClass2 131 { 130 132 protected: 131 static float someList_s;133 static float someList_s; 132 134 }; 133 135 }}} … … 150 152 const int MAX_ITERATIONS = 5; 151 153 152 for (int i = 0; i < MAX_ITERATIONS; i++) { } // Instead of (... i < 5; ...)154 for (int i = 0; i < MAX_ITERATIONS; i++) { } // Instead of (... i < 5; ...) 153 155 }}} 154 156 … … 165 167 public: 166 168 std::string getName() 167 { return name_; }169 { return name_; } 168 170 169 171 void setName(const std::string& name)