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
It just occurred to me that many of the functions in the comparators module of the library are actually transparent function objects since they can compare instances of different types and use perfect forwarding. However they lack the is_transparent member types that allows some containers to detect that they are function objects.
Next task: check that they satisfy the transparent function object requirements, add the is_transparent member type accordingly, and add tests if it makes sense.
The text was updated successfully, but these errors were encountered:
I added is_transparent to partial/weak/total_less/greater in 158f721.
Next step is to check whether it is possible to do it in a sensible way for the other comparators, which might not be possible for the refined versions, but I have to check to make sure.
In the meantime, I might have to expose the name of the function objects because passing decltype(total_less) to std::set apparently doesn't work, and having to pass std::remove_cvref_t<decltype(total_less)> is not user friendly. I guess that I will travel the simple road and have names like total_less_t: it's discoverable, usable, and not that important in the grand scheme of things since it provides a feature that isn't used by the sorting library itself.
is_transparent was also added to non-refined versions of natural_less and case_insensitive_less, and I exposed the types of the basic versions of every comparator of the module. Moreover natural_less can now compare different collections as long as they have the similar element types.
It just occurred to me that many of the functions in the
comparators
module of the library are actually transparent function objects since they can compare instances of different types and use perfect forwarding. However they lack theis_transparent
member types that allows some containers to detect that they are function objects.Next task: check that they satisfy the transparent function object requirements, add the
is_transparent
member type accordingly, and add tests if it makes sense.The text was updated successfully, but these errors were encountered: