Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
kamen69952yHaven't dabbled too much in C++, but if both are valid, then it can be reasoned towards both variants (and the third - with a space on both sides of the operator)
-
C0D4681382yIt's not my fault you don't live on the greater plane of existence where int *foo() is acceptable.
Bloody muggles and their int* foo() mentality 🤷♂️ -
C0D4681382y@12bitfloat but I'm using the data returned from the function as pointer, hence the *s position.
If I was just declaring an int* X = 5; then thats me saying that X is 5 and assigned at that moment, but from foo() it's collected from somewhere else.
Get with the times boi!! -
It is bad enough my IDE tries to fix this shit for me. Now it appears both ways because of my code and the auto generated code.
The function isn't a pointer or reference. It returns that shit. -
slar3002yWhatever clang-format does, I'm so past formatting my code manually.
Now if I get to setup my own .clang-format it it would be int& foo()
Related Rants
-
xjose97x19Just saw a variable in C named like this: long time_ago; //in a galaxy far away I laughed no stop.
-
Unskipp24So this happened last night... Gf: my favorite bra is not fitting me anymore Me: get a new one ? Gf: but it ...
-
sam966911Hats off to this lady .... I would have just flipped the machine
int* foo(); and int& foo();
if you're a
int *foo(); and int &foo();
kinda guy, you're fucking weird. And also wrong
rant
c++