Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 15 and Version 16 of code/C++_styleguide


Ignore:
Timestamp:
Sep 4, 2008, 7:09:56 PM (16 years ago)
Author:
rgrieder
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/C++_styleguide

    v15 v16  
    103103Names representing types must be in mixed case (CamelCase) starting with upper case.
    104104{{{
    105 class SavingsAccount {
    106 };
    107 
    108 struct SimpleStruct {
     105class SavingsAccount
     106{
     107};
     108
     109struct SimpleStruct
     110{
    109111};
    110112}}}
     
    118120Memeber variables of classes all end with an underline:
    119121{{{
    120 class TestClass {
    121 
     122class TestClass
     123{
    122124private:
    123   int numberOfTimes_;
     125    int numberOfTimes_;
    124126};
    125127}}}
    126128Static variables of classes have to end with '_s':
    127129{{{
    128 class TestClass2 {
    129 
     130class TestClass2
     131{
    130132protected:
    131   static float someList_s;
     133    static float someList_s;
    132134};
    133135}}}
     
    150152const int MAX_ITERATIONS = 5;
    151153
    152 for (int i = 0; i < MAX_ITERATIONS; i++) {} // Instead of (... i < 5; ...)
     154for (int i = 0; i < MAX_ITERATIONS; i++) { } // Instead of (... i < 5; ...)
    153155}}}
    154156
     
    165167public:
    166168    std::string getName()
    167       { return name_; }
     169        { return name_; }
    168170
    169171    void setName(const std::string& name)