|
|
# OpenFOAM C++ Coding Style Guide
|
|
|
<!-- --- title: The OpenFOAM C++ Coding Style Guide -->
|
|
|
|
|
|
This sets out some guidelines for the coding style in the OpenFOAM
|
|
|
code base. As usual, *there are no rules without exceptions*, but
|
... | ... | @@ -6,7 +6,7 @@ following these guidelines does help people navigating the code and |
|
|
making changes. It also greatly eases the task of integrating community
|
|
|
code contributions and enhances long-term maintenance.
|
|
|
|
|
|
---
|
|
|
--
|
|
|
|
|
|
## Code
|
|
|
|
... | ... | @@ -294,7 +294,7 @@ For many more details see the |
|
|
code;
|
|
|
}
|
|
|
```
|
|
|
Range-base for should have a space surrounding the ':'
|
|
|
Range-based for should have a space surrounding the ':'
|
|
|
```
|
|
|
for (auto i : range)
|
|
|
{
|
... | ... | @@ -314,7 +314,7 @@ For many more details see the |
|
|
forAll (
|
|
|
```
|
|
|
In many cases, the new `forAllIters` and `forAllConstIters` macros
|
|
|
provide a good means of cycling through iterators (when a range-base
|
|
|
provide a good means of cycling through iterators (when a range-based
|
|
|
for doesn't apply). These use the C++11 decltype and work without
|
|
|
explicitly specifying the container class:
|
|
|
```
|
... | ... | |