From Jason Turner
Watch on YouTube

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().

Resources

Tags