std::find는 operator==가 정의되어 있을 때 사용 가능, 정의되어 있지 않다면 std::find_if에서 별도 비교식을 만들어 넣은 다음 사용 가능.

 

 

https://en.cppreference.com/w/cpp/algorithm/find

 

std::find, std::find_if, std::find_if_not - cppreference.com

(1) template< class InputIt, class T > InputIt find( InputIt first, InputIt last, const T& value ); (until C++20) template< class InputIt, class T > constexpr InputIt find( InputIt first, InputIt last, const T& value ); (since C++20) template< class Execut

en.cppreference.com

 

'개인 공부 > STL' 카테고리의 다른 글

[unordered_set] 기본 자료형을 쓰지 않을 경우  (0) 2023.02.08
[mssql] 일괄 insert  (0) 2022.12.20
std::list erase시의 _Orphan_ptr에서 메모리 참조 오류  (0) 2022.12.07
remove_if  (0) 2022.11.21
remove와 erase  (0) 2022.11.21

+ Recent posts