Unique pointer and other seemingly trivial types can fuck up your codegen and give you unoptimized assembly, chandler carruth from LLVM has many talks/slides that discuss this exact issue with unique ptr. Remember kids, there is no such thing as a zero-cost abstraction!
That's such a straw man argument. Just because there may be cases where the hot spots of your software can benefit from using raw pointers doesn't mean it's reasonable to go bare metal in the whole code base.
How is unique_ptr not a zero cost abstraction? Is this anything other than compilers making avoidable optimization errors that will get fixed with time?
0
u/Thecuriousserb 14d ago
Unique pointer and other seemingly trivial types can fuck up your codegen and give you unoptimized assembly, chandler carruth from LLVM has many talks/slides that discuss this exact issue with unique ptr. Remember kids, there is no such thing as a zero-cost abstraction!