|
|
|
|
|
by Dylan16807
36 days ago
|
|
I don't think that's a very close spirit? Saying abstractions that do exist should have no runtime cost is very different from saying which controls need to be available. This isn't really about abstractions at all, this is about micromanaging which variant of MOV the compiler uses because of knock-on effects on the cache. |
|
Bjarne Stroustrup's criterion for language design is that C++ is an abstraction in itself over writing in assembly, and the language design should not get in the way by introducing overhead costs. C++ should allow the programmer to express their intent without losing performance relative to assembly, and it fails in this case due to undefined behavior.
So when the compiler doesn't let you implement your low-level code, it is a failure of the language and compiler relative to the design criteria of C++.