QuantLib Style Guidelines

The standard style for QuantLib code is shown in the following listing. You can write in your own style if you don't feel comfortable with this one; however, keep in mind that consistency would enhance readability for developers accustomed to the existing body of code. Also, there should be no real tabs in the code; four spaces should be used instead. If you don't follow this convention, other developers are likely to see your code with the wrong indentation.
#define SOME_MACRO                            // all uppercase

typedef double SomeType;                      // camelcase, starting capital

class SomeClass {                             // camelcase, starting capital
    void method();
    Real anotherMethod(Real x,                // camelcase, starting lowercase
                       Real y) const;
    Real member() const;                      // getter, no leading "get"
    void setMember(Real);                     // setter, leading "set"
    Real member_;                             // camelcase, starting lowercase,
    Integer anotherMember_;                   // trailing underscore

struct SomeStruct {
    Real foo;                                 // struct members:
    Integer bar;                              // no trailing underscore

class SomeOtherClass {
    typedef Real* iterator;                   // no camelcase for consistency
    typedef const Real* const_iterator;       // with STL conventions

Size someFunction(Real parameter,             // one parameter per line,
                  Real anotherParameter) {    // camelcase, starting lowercase
    Real localVariable = 0.0;
    if (condition) {                          // brackets here...
        localVariable += 3.14159;
    } else {                                  // ...here...
        localVariable -= 2.71828;
    }                                         // ...and here.
    return 42;