6 ms·
OK, but... I see three options. 1) Use the non-zero-cost abstraction to do X safely. 2) Write the equivalent abstraction to do X safely, which will cost you
by AnimalMuppet 6y ago
OK, but...
I see three options. 1) Use the non-zero-cost abstraction to do X safely. 2) Write the equivalent abstraction to do X safely, which will cost you the time to write and will probably be buggier than C++'s version. 3) Don't do X.
The fourth option - do X but in an unsafe way - should not be on the table for a professional developer.
Now, C++'s philosophy is that you can't write your own thing to do X more efficiently than C++'s builtin version. They may not perfectly achieve that in all cases, but they come fairly close. That plus bugs means that I won't reach for option 2 unless I have really good reason to think I can do better.
That leaves using the builtins to do X safely, or not doing X. At least that's how it looks to me...