Skip to content
mogemimi edited this page Dec 23, 2015 · 12 revisions

C++ Coding Style

We don't have any explicit C++ coding standards. Alternatively Pomdog use ClangFormat so please see ClangFormat file for details about basic coding style of this project.

If you would like to contribute and submit pull request, you don't need to worry about some trivial style (e.g. asterisk * and ampersand & position with const in function declaration). We just want things to work automatically (such as ClangFormat), so feedback and contributions are very welcome!

In general you should follow the widely used coding standards, such as the followings:

And the following links will help you write C++:

If you need further information, please visit:

How to Use ClangFormat

Install ClangFormat using Homebrew

brew install clang-format

Run ClangFormat

From the root of your engine directory, run the following at command line:

clang-format path/to/filename.cpp

To edit a file, use -i option:

clang-format -i path/to/filename.cpp

See also

For more information about clang-format, please see:

How to Use Code Refactoring Tool

cd pomdog
python tools/refactor_sources.py experimental/
python tools/refactor_sources.py include/
python tools/refactor_sources.py src/