align_var_def_amp_style

How to consider (or treat) the '&' in the alignment of variable definitions.

The align_var_def_span must be set to 1 or more for this option work.

Examples

Base Example:

int main()
{
    int base = 9;
    int & booOne;
    int &roo;
    unsigned char& oochoo;

    std::cout << sizeof(base) << '\n';
    return 0;
}

Base config:

align_var_def_span = 1
align_var_def_amp_style = 0 # this value gets changed for every example

value 0

After:

int main()
{
    int            base = 9;
    int &          booOne;
    int &          roo;
    unsigned char& oochoo;

    std::cout << sizeof(base) << '\n';
    return 0;
}

value 1

After:

int main()
{
    int          base = 9;
    int          & booOne;
    int          &roo;
    unsigned char& oochoo;

    std::cout << sizeof(base) << '\n';
    return 0;
}

value 2

Works as value 1 for some reason.

See also