22 ms·
The linker can consolidate binary-identical functions if you really want, although generally linkers limit themselves to string consolidation. "Defined ABI" is
by pjc50 11y ago
The linker can consolidate binary-identical functions if you really want, although generally linkers limit themselves to string consolidation.
"Defined ABI" is something of a problem, as C++ is required to work on a variety of current and future hardware platforms, with disparate calling conventions and the like.
Monkeypatching is not something I understand how or why one would attempt in C++, but there's always the option of building yourself a C-style collection of function pointers and swapping them out at runtime. Or, may God have mercy on your soul, Windows COM.
Templates are C++'s metaprogramming feature. Without them there would have to be another means of implementing generics. The syntax is often ugly and occasionally bananas, but they're one of the things that make C++ what it is.