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

Asked 1 years ago, Updated 1 years ago, 79 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.