From e2d67a9b4a6d5c287e36c2fc9ee7834239cb42ea Mon Sep 17 00:00:00 2001 From: Emil Jarosz Date: Sat, 12 Sep 2020 20:37:36 +0000 Subject: [PATCH] Update 'Coding guidelines' --- Coding-guidelines.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/Coding-guidelines.md b/Coding-guidelines.md index 3e55672..c5fe1b7 100644 --- a/Coding-guidelines.md +++ b/Coding-guidelines.md @@ -1 +1,27 @@ -To be added \ No newline at end of file +# Coding Guidelines +## Includes +Header file includes shall be grouped by the categories below, with includes within each group being sorted alphabetically, and with empty lines seperating the groups: +* The `gp_config` header, if required +* Headers from the gplib project +* C++ standard library headers +* C standard library headers + +Headers from the gplib project shall be included using the quote form of the `include` directive. +Headers included conditionally shall be sorted as normal, and have no additional empty lines around them. +### Example Code +```cpp +#pragma once + +#include "gp_config.hpp" + +#include "gp/algorithm/foreach.hpp" +#ifndef NO_FP_MATH + #include "gp/math/fp_math.hpp" +#endif +#include "gp/math/integer_math.hpp" + +#include +#include + +#include +``` \ No newline at end of file