Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Place asterisk close to variable name not type in variable declarations #6

Open
Konard opened this issue Aug 8, 2020 · 3 comments
Open
Projects

Comments

@Konard
Copy link
Member

Konard commented Aug 8, 2020

Link* source; should be changed to Link *source;

@Konard Konard added this to To do in Refactoring via automation Aug 8, 2020
@uselessgoddess
Copy link
Member

Why? This is very inconvenient.
For example

std::same_as<Link*, decltype(source)> // should be changed to std::same_as<Link *, decltype(source)>

Similarly with references:

int lol;
auto &&object = std::move(lol);
std::same<int &&, decltype(object)>;

The asterisk and ampersand are type specifiers, but not variables

This might once have been appropriate in C lang

int *x, *y, *z; // zoomer-style ==> int* x, * y, * z;

in C++

int* x;
int* y;
int* z;

This is really a CRINGE. Stroustrup seemed to have lived in vain

@Konard
Copy link
Member Author

Konard commented Jun 27, 2021

Hm... Looks like this another design decisions that should be applied across all the repositories. And yes, I agree with you.
But

int* x;
int* y;
int* z;

is also possible in C language, not only in C++.

@uselessgoddess
Copy link
Member

I know. Look at stdlib.h in your pc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Refactoring
  
To do
Development

No branches or pull requests

2 participants