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.
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
orfind
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.