指针/引用的CLION格式

时间:2017-08-13 02:06:23

标签: c++ formatting clion

从重新格式化,我想:

int* n;
int& m;
int const* o;

相反,我得到:

int *n;
int &m;
int const *o;

如何让CLion做我想做的事?

1 个答案:

答案 0 :(得分:6)

Prevent Auto Format from align Pointer to variable指向https://www.jetbrains.com/help/clion/2016.3/code-style.html

在设置

中搜索了许多选项后
Editor -> Code Style -> C/C++ -> Spaces ->

From:
    before '*' in declarations
    before '&' in declarations

to:
    after '*' in declarations.
    after '&' in declarations.