style
esc
  • Loading…

Start hereC++ Style Guide template

Conventions for writing, structuring, formatting and shipping modern C++23 that builds clean on MSVC, Clang and GCC.

A ready-to-build Premake workspace with the guide's layout, base header, logging and asserts, the appendix configs, a sample app, a sandbox, a first test and an MSVC CI workflow.

  1. 1

    Download

    Pick a name and short code. Every file, folder, namespace and macro is renamed for you.

  2. 2

    Run setup

    scripts/Setup.sh (or .bat) adds spdlog and doctest as submodules, formats the sources and generates project files.

  3. 3

    Build

    Makefiles on macOS and Linux, a Visual Studio solution on Windows. Debug, Release and Dist build warning-free.

What you get

Project/
├── .github/
│   └── workflows/
│       └── ci.yml
├── docs/
│   └── adr/
│       └── 0001-project-scope.md
├── Project/
│   ├── src/
│   │   ├── Project/
│   │   │   ├── Core/
│   │   │   │   ├── Application.cpp
│   │   │   │   ├── Application.h
│   │   │   │   ├── Assert.h
│   │   │   │   ├── Base.h
│   │   │   │   ├── Log.cpp
│   │   │   │   ├── Log.h
│   │   │   │   ├── Timestep.h
│   │   │   │   └── Timestep.test.cpp
│   │   │   └── Platform/
│   │   │       ├── MacOS/
│   │   │       └── Windows/
│   │   ├── prjpch.cpp
│   │   ├── prjpch.h
│   │   ├── Project.h
│   │   └── TestMain.cpp
│   └── premake5.lua
├── ProjectApp/
│   ├── src/
│   │   └── Main.cpp
│   └── premake5.lua
├── Sandbox/
│   ├── src/
│   │   └── Main.cpp
│   └── premake5.lua
├── scripts/
│   ├── GenerateProjects.bat
│   ├── GenerateProjects.sh
│   ├── Setup.bat
│   └── Setup.sh
├── .clang-format
├── .clang-tidy
├── .gitignore
├── Dependencies.lua
├── premake5.lua
├── README.md
└── TOOLCHAIN.md