使用clang格式对齐单行函数定义

Zou*_*uch 6 c++ clang-format

我知道可以将变量定义和影响对齐clang-format,使用AlignConsecutiveAssignmentsAlignConsecutiveDeclarations得到类似的东西

int          a_value;
unsigned int another_value;
float        a_last_value;

a_value       = 2;
another_value = 3;
a_last_value  = 42.0f;

// Or both at the same time    
int          a_value       = 2;
unsigned int another_value = 3;
float        a_last_value  = 42.0f;
Run Code Online (Sandbox Code Playgroud)

现在,有没有办法用单行函数/方法做一个类似的东西(AllowShortFunctionsOnASingleLine例如使用单行)?我的意思是得到类似的东西

void SetPositions(const vec3_array& p) { m_Data.Positions = p; }
void SetUVs(const vec2_array& u)       { m_Data.UVs = u; }
void SetNormals(const vec3_array& n)   { m_Data.Normals = n; }
void SetIndices(const UIntArray& i)    { m_Data.Indices = i; }
Run Code Online (Sandbox Code Playgroud)

或者甚至是

void SetPositions(const vec3_array& p) { m_Data.Positions = p; }
void SetUVs      (const vec2_array& u) { m_Data.UVs = u; }
void SetNormals  (const vec3_array& n) { m_Data.Normals = n; }
void SetIndices  (const UIntArray& i)  { m_Data.Indices = i; }
Run Code Online (Sandbox Code Playgroud)

代替

void SetPositions (const vec3_array& p) { m_Data.Positions = p; }
void SetUVs(const vec2_array& u) { m_Data.UVs = u; }
void SetNormals(const vec3_array& n) { m_Data.Normals = n; }
void SetIndices(const UIntArray& i) { m_Data.Indices = i; }
Run Code Online (Sandbox Code Playgroud)