-
Notifications
You must be signed in to change notification settings - Fork 396
Coding Guidelines
Stuart Mentzer edited this page Aug 6, 2015
·
26 revisions
This is the preliminary EnergyPlus C++ coding guidelines. It is likely that this will evolve and grow considerably over time.
- Header file names have a .hh extension
- Source file names have a .cc extension
- Header and source files (we call these both "source" files in some contexts) have Linux-style (\n) line terminators (dos2unix can convert to this)
- Header files have include guards wrapping the whole file of the form
#ifndef NamespaceName_FileName_hh_INCLUDED
#define NamespaceName_FileName_hh_INCLUDED
...
#endif
- namespaces are normally given lowercase names
- namespaces are marked like this:
namespace thing1 {
namespace thing2 {
...
} // thing2
} // thing1
- No extra indentation in namespaces