I was wondering what code style we are using as the current code base has a mix of tabs and spaces that somewhat clashes with my editor settings. For my currently private for and some other code I currently use:
clang-format --style="{BasedOnStyle: Google, PointerAlignment: Left, DerivePointerAlignment: false}" -i foo.cpp
which is basically the Google code style
(https://google-styleguide.googlecode.com/svn/trunk/cppguide.html)
but the pointer alignment ("int* baz" vs "int *baz") is not derived from the rest of the code but forced to the former style. Also I'm using "#pragma once" instead of include guards. By the way you might find the clang for Windows installer helpful and that also includes clang-format
http://llvm.org/builds/
I was wondering what code style we are using as the current code base has a mix of tabs and spaces that somewhat clashes with my editor settings. For my currently private for and some other code I currently use:
which is basically the Google code style
(https://google-styleguide.googlecode.com/svn/trunk/cppguide.html)
but the pointer alignment ("int* baz" vs "int *baz") is not derived from the rest of the code but forced to the former style. Also I'm using "#pragma once" instead of include guards. By the way you might find the clang for Windows installer helpful and that also includes clang-format
http://llvm.org/builds/