禁用指针对齐

Suv*_*Sel 5 clang clang-format

我使用以下样式选项以 clang-format 进行指针对齐:

DerivePointerBinding: false
PointerBindsToType: false
DerivePointerAlignment: false
PointerAlignment: Left
Run Code Online (Sandbox Code Playgroud)

例如,我想区分指针 ( *) 和引用 ( )&

auto& ret;
char *ch;
Run Code Online (Sandbox Code Playgroud)

现在,pointer( *) 和reference( &) 要么左对齐,要么右对齐,要么居中对齐。

如何仅禁用指针对齐?

Lor*_*olt 3

不可能。您只能选择“左”或“右”。