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
-
You need to accept that the compiler and optimizer are smarter than you are.
Let them optimize it. Constexpr even implies inline, yon can leave out the inline keyword too -
atheist99812yThe inline keyword also has very little to do with code inlining, most people using it in the name of performance don't understand it anyway. It's about declarations in multiple compilation units being OK
-
Grumm18232yI am waiting to the official release of Carbon.
It should be the typescript version of C++ :D -
@atheist preach it
I'm very much in the camp of "if its worth to inline, the compiler/optimizer will do it for me" -
@atheist declarations in multiple compilation units being OK, isn't that more like static?
-
atheist99812y@d4ng3r0u5 static is about only being linkable within a single compilation unit, so it's kinda similar (you can have the same static thing declared in multiple compilation units and the compiler won't complain). I'm sure there are subtler differences, I'm doing this from memory.
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
I swear to god "old school" C++ devs are menace to humanity
Why yes let's make this one line long function, that could even be constexpr, and make it a macro.
Why the fuck not, let's make compiler errors worse by foregoing any type checking. Let's throw away namespacing as well, great.
Fuck you.
I shouldn't have to dig through 4 levels of nested macros just cause "muh performance" and "we've always done it like that".
Shit yourself.
rant
macros
c++