Summary
This episode introduces the new contains() member function coming in C++20 for associative containers (set, multiset, map, multimap, unordered_set, unordered_map). Jason demonstrates how this new method simplifies and potentially optimizes checking for the existence of elements in containers, replacing awkward patterns like using count() > 0 or comparing find() against end().
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[set]74% match -
[associative.reqmts]66% match -
[unord.set.overview]60% match -
[unord.map.overview]60% match -
[unord.multiset.overview]60% match -
[unord.set]59% match -
[unord.multimap]59% match -
[set.overview]59% match -
[unord.map]59% match -
[unord.multimap.overview]59% match - + 16 more related sections