4 ms·
C and C++ are often used to achieve max performance. For max performance devs have to guarantee inlining. Which means programmers intentionally choose bigger co
by SleepyMyroslav 3y ago
C and C++ are often used to achieve max performance. For max performance devs have to guarantee inlining. Which means programmers intentionally choose bigger code size and instantiation of sort algorithm code for every type and comparison combination. Function pointers to comparison operators are not relevant for max performance part of the community.
For ValWithPtr to make sense it needs its semantics defined. Correct C++ types can be deep copying, move only, reference counted, singleton instance etc. For example typed deep copy version without attempting any verification (link to compiler explorer): https://godbolt.org/z/3sesYY8of https://godbolt.org/z/3sesYY8of
If it is not helpful for you please feel free to ignore all of the above.