#Should I avoid the use of inline functions?

9 messages · Page 1 of 1 (latest)

modest coral
red moonBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

modest slate
modest coral
#

Sorry I don't know much (don't know anything) about compiler flags other than -I and -Wall

modest slate
#

a register variable has the "behavior" that one cannot take a reference to it, otherwise it's UB

but for the same reason, it likely poorly maps to the fact it will actually be put in register

modest slate
#

typically, if your linker can see all the method definitions and is optimizing, it might decide which method deserves to be inlined, even cross source files

#

I think inline/register are essentially coming from a time where compilers needed help and couldn't really decide on what should be done to activate some speed (like loop unrolling techniques, ...)

maybe with modern compilers and their optimizers, uses of those buddies are less and less relevant

If I got right, even restrict is not that useful anymore

royal smelt
#

I avoid inlining functions for the reasons you and Judekeyser brought up. It simply isn't worth the brainpower, unless you can prove that it results in better Assembly being generated in very optimized circumstances. But most of the time it is just a useless keyword.