Previous:
Differences with the C Coding Style
, Up:
Top
Index and Table of Contents
#define
:
Macros and code sanity
#define
:
Preprocessor directives layout
#if 0
:
File layout
#ifdef
:
Preprocessor directives layout
.h
files
:
Header files and header inclusion
_type
:
Typedef suffix
alignment, pointer declarations
:
Declarations
asm
:
Statements
blocks
:
Blocks
braces
:
Blocks
break
:
Statements
capitalization
:
Macros and code sanity
capitalization
:
Name capitalization
case
:
Control structures
casts, do not use
:
Casts
catch
:
Control structures
class, name
:
General naming conventions
commas
:
Statements
comments, after
#else
and
#endif
:
Preprocessor directives layout
comments, before functions only
:
Code density and documentation
comments, language
:
Comment layout
comments, layout
:
Comment layout
const_cast
:
Casts
continue
:
Statements
control structure keywords
:
Control structures
CR+LF
:
Trailing whitespace
CR+LF
:
File layout
declarations with initialization
:
Declarations
declarations, one per line
:
Declarations
directives, layout
:
Preprocessor directives layout
directives, macros
:
Macros and code sanity
disabling code blocks
:
File layout
do
:
Control structures
Doxygen
:
Comment layout
Doxygen
:
Code density and documentation
dynamic_cast
:
Casts
empty loop body
:
Control structures
examples, warning
:
Beware of the examples
expressions, padding with spaces
:
Expressions
for
:
Control structures
for
, empty body
:
Control structures
global, object
:
Global scope and storage
goto
:
Statements
header files
:
Header files and header inclusion
headers, inclusion
:
Header files and header inclusion
if
:
Control structures
imperative
:
Comment layout
inheritance
:
Lexical Rules
initialization
:
Declarations
inner declarations
:
Declarations
keywords, followed by whitespace
:
Statements
keywords, followed by whitespace
:
Control structures
layout, comments
:
Comment layout
layout, directives
:
Preprocessor directives layout
layout, files
:
File layout
line count within function bodies
:
Code density and documentation
lines, maximum length
:
File layout
macro calls
:
Macros and code sanity
macro names
:
Name capitalization
MAY
:
Vocabulary
multiple declarations
:
Declarations
multiple inclusion protection
:
Header files and header inclusion
MUST
:
Vocabulary
MUST NOT
:
Vocabulary
names
:
Naming conventions
names, case of
:
Name capitalization
names, header protection key
:
Header files and header inclusion
names, macros
:
Name capitalization
naming conventions
:
Naming conventions
object, with static storage
:
Global scope and storage
operators, padding
:
Expressions
OPTIONAL
:
Vocabulary
pointerness, alignment of declarations
:
Declarations
preprocessor macros
:
Macros and code sanity
preprocessor, directives
:
Preprocessor directives layout
private
:
Lexical Rules
private, member names
:
General naming conventions
protected
:
Lexical Rules
protected, member names
:
General naming conventions
public
:
Lexical Rules
public, member names
:
General naming conventions
Rationale
:
Comment layout
Rationale
:
Lexical Rules
Rationale
:
Typedef suffix
Rationale
:
Trailing whitespace
Rationale
:
File layout
Rationale
:
Typedef suffix
Rationale
:
Comment layout
Rationale
:
Macros and code sanity
Rationale
:
Lexical Rules
Rationale
:
Casts
Rationale
:
Comment layout
rationale, definition
:
Rationale - intention and extension
RECOMMENDED
:
Vocabulary
reinterpret_cast
:
Casts
REQUIRED
:
Vocabulary
requirement
:
Vocabulary
return
:
Statements
RFC 2119
:
Vocabulary
semicolons
:
Statements
SHALL
:
Vocabulary
SHOULD
:
Vocabulary
sizeof
:
Control structures
spaces, within expressions
:
Expressions
spelling mistakes
:
Comment layout
statement, multiple per line
:
Statements
static storage, objects
:
Global scope and storage
static_cast
:
Casts
switch
:
Control structures
tabulations
:
Trailing whitespace
template
:
Control structures
template, specialization
:
Control structures
template<>
:
Control structures
throw
:
Control structures
trailing whitespace
:
Trailing whitespace
transtyping, do not use
:
Casts
try
:
Control structures
typedef, suffix
:
Typedef suffix
typeid
:
Control structures
using namespace
:
Header files and header inclusion
variables, multiple per line
:
Declarations
virtual
:
Lexical Rules
visibility
:
Lexical Rules
while
:
Control structures
while
, empty body
:
Control structures
whitespace, at the end of a line
:
Trailing whitespace
Table of Contents
EPITA C++ Coding Style Guidelines
1 How to read this document
1.1 Vocabulary
1.2 Rationale - intention and extension
1.3 Beware of the examples
2 Naming conventions
2.1 General naming conventions
2.2 Name capitalization
2.3 Typedef suffix
3 Preprocessor-level specifications
3.1 File layout
3.2 Preprocessor directives layout
3.3 Macros and code sanity
3.4 Comment layout
3.5 Header files and header inclusion
4 Writing style
4.1 Blocks
4.2 Declarations
4.2.1 Alignment
4.2.2 Declarations
4.3 Statements
4.4 Expressions
4.5 Control structures
4.5.1 General rules
4.5.2 Loops, general rules
4.6 Trailing whitespace
5 Object Oriented considerations
5.1 Lexical Rules
5.2 Do's and Don'ts
6 Global specifications
6.1 Casts
6.2 Global scope and storage
6.3 Code density and documentation
7 Project layout
7.1 Directory structure
8 Differences with the C Coding Style
Index and Table of Contents