k***@gmail.com
2018-11-04 22:38:47 UTC
std::set has a find member function. This member function uses the nature of a set to achieve O(log n) complexity. There exists a std::find algorithm that can be used with any container and has a complexity of O(n).
C++20 added a contains member function to some containers. Once again, the contains member function of std::set uses the nature of a set to achieve O(log n) complexity. However, there isn't (to my knowledge) a generic std::contains algorithm for containers that don't have a contains member function.
Personally, the absence of std::contains seems like an oversight. Is it?
C++20 added a contains member function to some containers. Once again, the contains member function of std::set uses the nature of a set to achieve O(log n) complexity. However, there isn't (to my knowledge) a generic std::contains algorithm for containers that don't have a contains member function.
Personally, the absence of std::contains seems like an oversight. Is it?
--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+***@isocpp.org.
To post to this group, send email to std-***@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/689fd0dc-0ddf-464f-b041-f5c071d643df%40isocpp.org.
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+***@isocpp.org.
To post to this group, send email to std-***@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/689fd0dc-0ddf-464f-b041-f5c071d643df%40isocpp.org.