你喜欢这样:
int a;
double b;
char *pStr;
std::vector<int> arrInt;
std::vector<std::string> arrStr;
std::map<std::string> mapStr;
还是这样:
int a;
double b;
float c;
float d;
char *pStr;
std::vector<int> arr;
std::vector<std::string> arrStr;
std::map<std::string> mapStr;
我喜欢第一种,只是当某个类型过长时,其他则可以不和他看齐,例如这样:
int a;
double b;
float c;
float d;
char *pStr;
std::vector<int> arrInt;
std::vector<std::string> arrStr;
std::map<std::string> mapStr;
各位呢
------解决方案--------------------
你不说,我还真没注意。
应该类似第二种吧。
------解决方案--------------------
对齐能对齐的所有元素!
- C/C++ code
int a ; double b ; char * pStr; std::vector<int > arrInt; std::vector<std::string> arrStr; std:: map<std::string> mapStr;
------解决方案--------------------
不会
------解决方案--------------------
在看到2L之后,我以为LZ是来消遣别人的,害我看了好久都看不出两种格式的不同。
- C/C++ code
int a; double b; float c; float d; char *pStr; std::vector<int> arrInt; std::vector<std::string> arrStr; std::map<std::string> mapStr;
------解决方案--------------------
------解决方案--------------------
个人习惯不同,没有太大影响
------解决方案--------------------
我也喜欢第一种
------解决方案--------------------
我喜欢第一种
------解决方案--------------------
理解你,我写的编程规范里直接就是这么要求的,做为评定代码是否合格的标准之一。
------解决方案--------------------
看的头西晕的。。
------解决方案--------------------
+1
------解决方案--------------------
我会把注释对齐。。。。。
------解决方案--------------------
------解决方案--------------------
个人认为都挺好的.
------解决方案--------------------
类的成员 我会对齐
函数中的变量 不会
------解决方案--------------------
尼玛啊,我没洁癖的.
------解决方案--------------------
各有所好
------解决方案--------------------
充长见识, 学习来了!