There are no zero-cost abstractions.
There are no zero-cost abstractions
explain this then, tranime++ shill
Everything should be done with assembly.
>-funroll-loops
wow look a zero-cost abstraction
cope
Not OP but c++ is a clusterfuck abomination of abstractions shoved into a trenchcoat pretending to be a low level. Rust on the other hand is actually a well designed language.
>Rust on the other hand is actually a well designed language
pure cope from a rustranny
that's not what abstraction means
WRONG
abstractions can contain information which raw data either doesn't contain at all or it incurs cost to check it
not only are there zero-cost abstractions, there are negative cost abstractions; for example a sum of a range/series
literally is, brainlet nocoder, language itself is an abstraction to ISA, a for loop not necessarily becoming a handwritten loop in ASM is just one example
Depends on how you define "cost".
Trere are no sentient anime posters.
not zero cost
you'll also need -fwhole and the cost will be compilation time
Don't care
OH NO NO NO NO SEPPLESBROS...
>proper zero-sized types
>proper unsized types
>proper never type
>no special "incomplete" type (void)
>no /*unspecified*/ types
Yeah, Rust is a well designed language
Retard
Not even assembly nor machine code is zero cost. When you use a register in assembly it's actually a virtual register. x86 only has a few registers you can use but the cpu internally has i think it was something between 128-200 registers. The machine code doesn't get executed directly either. It's converted to microcode at runtime, kinda like JIT. Thats why you can get microcode updates in windows update/intel-ucode (on linux) that fixes bugs in cpu instructions.
is a point struct a zero cost abstraction?
why would
int x,y = 5,25
x++
be slower than
pt p = {5,25}
p.x++
thank you for reading
Based.