linksplatform / Data.Triplets.Kernel

LinksPlatform's Platform.Data.Triplets.Kernel native library.
https://nuget.org/packages/Platform.Data.Triplets.Kernel
The Unlicense
1 stars 4 forks source link

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

Open Konard opened 4 years ago

Konard commented 4 years ago

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

uselessgoddess commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

I know. Look at stdlib.h in your pc