You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
__is_trivially_equality_comparable is a trait that is true if a type is memcmp comarable for == and != against itself. We can use that on Clang along with existing metaprogramming.
This will allow covering more types like struct containing only integers with defaulted comparison and enums without user-defined comparison. This includes user defined types, for which this cannot be achieved without "magic". Also this includes standard types, such as chrono::duration or pair<int, int> if their comparison is defaulted properly; this should be less burden that specializing traits for them all.
A separate escape hatch could be a good idea, due to quasi-supporting old Clang and "new" Intel, which may not have __is_trivially_equality_comparable, or may have more bugs in it.
These algorithms can be improved:
equal for all sizes
search, find_end, adjacent_find, find_first_of, search_n, unique, unique_copy for vector element sizes
mismatch for all sizes
find, find_last, remove, remove_copy, count for vector element sizes
replace for some vector element sizes (32-bit and 64-bit)