It may seem a little picky, but for me, there is nothing more annoying then running a beautifier and having it mess up the formatting of just one junk of code. If it was really bad, I just wouldn't use it. But when it is just sooooooo close, I end up spending a lot of time trying to fix it. You could argue that I am lazy programmer/poor typist; which I admit to at least one.
Take the code sample below. I was playing with C++11's uniform initialization syntax, which allows for the initialization of struct members from the constructor parameters. Cool right? How c/c++ has grown.
Beautify seems to be treating the UIS as a normal member initialization and a code block. I even downloaded the 2017 RC4 to see if this had been considered; it does not seem so.
There are a lot of knobs, so maybe I am just missing something. Thought I would put this note out there and see what comes back.
Thank you,
K. Miller
Before beautify (yes, the poor indentation is intentional) :
#include <iostream>
class test
{
public:
test(int a, int b, int c) :
p {a, b, c, 0}
{
}
private:
struct {
int a, b, c, d;
} p;
public:
void output(void)
{
std::cout << p.a << " " << p.b << " " << p.c << " " << p.d << std::endl;
}
};
main()
{
test t1(5,4,3);
t1.output();
}
After beautify:
#include <iostream>
class test
{
public:
test(int a, int b, int c) :
p
{
a, b, c, 0
}
{
}
private:
struct
{
int a, b, c, d;
} p;
public:
void output(void)
{
std::cout << p.a << " " << p.b << " " << p.c << " " << p.d << std::endl;
}
};
main()
{
test t1(5, 4, 3);
t1.output();
}