boostorg / multi_index

Boost.org multi_index module
http://boost.org/libs/multi_index
45 stars 59 forks source link

[Feature request] Add "contains" method to associative indexes, as of C++20 #35

Closed fgallegosalido closed 3 years ago

fgallegosalido commented 4 years ago

C++20 added a new method to the associative containers, contains, which takes a key and returns a boolean, indicating whether or not the element is in the container.

This releases us from using functions like count or find just for checking if the element is in the container, and be more explicit about our intentions.

As multi-index tries to be as similar as the STL counterparts, this is a logical addition.

joaquintides commented 3 years ago

Just added, will be released in Boost 1.78.