3 ms·
It’s not “C++’s” decision, it’s the compiler writer’s. Compilers are full of special handling of standard functions (memcpy is a common case) — those cases are
by gumby 4y ago
It’s not “C++’s” decision, it’s the compiler writer’s. Compilers are full of special handling of standard functions (memcpy is a common case) — those cases are called “compiler intrinsics”. They can also choose to call a function when you don’t expect it (e.g. when your hardware doesn’t have floating point support).
Does rust try to follow the platform C ABI? C++ implementations typically do when it is semantically meaningful.
- steveklabnik 4y agoRust doesn’t follow the platform C ABI unless you ask for it specifically. If you do, it will, and if you don’t, the ABI is unspecified for a reason.
- gumby 4y agoI wish c++ could get away with this. But the two languages (c++ and rust) explore slightly different parts of the design space.