Jim,
Thanks for maintaining this great tool! I noticed that astyle gets confused by C++11 static cast to R-value reference.
This code:
static_cast<_Args&&>(args)...
Gets reformatted as (notice the spaces):
static_cast < _Args && >(args)...
Also parameter pack in function declaration this is usually formatted like this:
_Args&&... args
Gets reformatted as (extra space after &&):
_Args&& ... args
It's easy enough to fix with sed, but it would be nice to add some logic to astyle to control formatting in these cases.
I am using version 3.1. My options:
astyle -r --suffix=none --style=allman --indent=spaces=4 --indent-cases --indent-col1-comments --break-blocks --pad-oper --pad-header --unpad-paren --align-pointer=type --align-reference=type --break-one-line-headers --remove-braces --attach-return-type --attach-return-type-decl --keep-one-line-statements --close-templates --convert-tabs --max-code-length=120 --break-after-logical .cpp .h
Thanks,
Andrey
https://en.cppreference.com/w/cpp/language/parameter_pack
https://www.linux-magazin.de/ausgaben/2015/08/c-11/2/
Last edit: André Simon 2023-03-29