I would like to ask you how to determine if a specific element exists in std::set!

Asked 2 years ago, Updated 2 years ago, 93 views

Please let me know if there is a way to check if there are any elements in the set without using for or auto

c++ container set stl

2022-09-22 22:00

1 Answers

In general, codes for determining which elements are present in STL containers are

const bool is_in = container.find(element) != container.end();

This is.


2022-09-22 22:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.