A baseline for ongoing development of C++ coding-conventions and best practices that can be adopted with ease. lets collectively increase consistency and code-quality by sharing experience, discussing options, and manifest decisions in this repo.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
heck ef41d77c6a folder structure 5 months ago
build-android folder structure 5 months ago
build-windows folder structure 5 months ago
doc folder structure 5 months ago
src Add example library code 9 months ago
test Test: Add example test 9 months ago
.clang-format Use clang-format for constistent portable IDE-independent formatting 9 months ago
.clang-tidy Use clang-tidy to express and validate coding conventions 9 months ago
.gitignore .gitignore 9 months ago
LICENSE Add LICENSE file (GPL3 as a default) 9 months ago
Makefile Build: Add GNU Make based build for src/ and test/ using local.conf build config (pEp standard) 9 months ago
Makefile.conf Build: Add GNU Make based build for src/ and test/ using local.conf build config (pEp standard) 9 months ago
README.md README.md corrections 9 months ago
local.conf.example Build: Add GNU Make based build for src/ and test/ using local.conf build config (pEp standard) 9 months ago

README.md

PROJECT_NAME

Resources

  • Repository: REPO url here

  • Change management: JIRA url here

  • Doc: Wiki link here

  • Maintainer: e-mail here

  • Build-maintainers:

    • Build windows: e-mail here
    • Build android: e-mail here
    • ...

Requirements & Platforms

Please add here the technical requirements of the project

  • License: GPL3
  • C++ standard: C++11 (or newer, but consider portability)
  • supported compilers: gcc/clang (must be supported at least)
  • Build sytem: GNU Make (Linux, macOS)

Coding conventions

  • Code-formatting: use clang-format (Please try to use the .clang-format with the least necessary changes (maintainability and consistency within pEp))
  • static-analysis: use clang-tidy (Please try to use the .clang-tidy with the least necessary changes (maintainability and consistency within pEp))

Filenames

implementation: .cc
header: .hh
template-implementation: .hxx

Namespaces

all pEp source code must be in a top level namespace pEp.
With this exception all other nested namespaces must be in CamelCase.

using namespace

it is never encouraged to do use namespace std;. In header files it is actually forbidden, and in implementation files it is stronly discouraged, because as soon as you want to templatize, the using namespace directive has to be replaced with explicit std:: prefixes, because the templateized implementation will have to be in a header file extension (.hxx)
This applies strongly for the namespace std and needs to be carefully considered for all other namespaces.

Include guards

Do not use #pragma once , use #ifdef/#define style (portability reasons)
naming key: PROJECTNAME_FILENAME (e.g. LIBPEPDATATYPES_FILENAME_HH)

Identifiers

  • types: all types must start with an uppercase letter, CamelCase is recommended.
  • variables: snake_case is recommended
  • functions: snake_case is recommended