TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
C++ Coding Standard
Search

Rule:  STY#010

This rule is Obsolete
Synopsis:Use the specified method/function declaration and definition layout
Language:C++
Severity Level:10
Category:Style


Description:

Method/function declaration:

  • everything before method name on a separate line;
  • first parameter on line below method name;
  • each parameter on a separate line, indented one level;
  • everything following the closing parentheses, such as const or = 0, on same line as that parentheses.

Example 1:

public:
    void
    Method();

Example 2:

public:
    virtual BOOL
    Method(
        const ULONG parameter1,
        CString&    parameter2) const;

Example 3:

public:
    static ULONG
    Method(
        const ULONG parameter1) const = 0;

Method/function definition: same layout as method declaration

Example 1:

void
CMyClass::Method()
{
    <statement>
}

Example 2:

BOOL
CMyClass::Method(
    const ULONG parameter1,
    CString&    parameter2) const
{
    <statement>
}

Example 3:

ULONG
CMyClass::Method(
    const ULONG parameter1)
{
    <statement>
}


Literature References:
Ellemtel rec. 22, adapted