C ++ STL中的set :: find()函数

2023-10-27

C ++ STL set :: find()函数 (C++ STL set::find() function)

set::find() function is a predefined function, it is used to check whether an element belong to the set or not, if element finds in the set container it returns an iterator pointing to that element.

set :: find()函数是预定义的函数,用于检查元素是否属于集合,如果元素在集合容器中找到,则返回指向该元素的迭代器。

Prototype:

原型:

    set<T> st; //declaration
    set<T>::iterator it; //iterator declaration
    it=st.find( const T item); 

Parameter: const T item

参数: const T项目

Return type: Iterator position

返回类型:迭代器位

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

C ++ STL中的set :: find()函数 的相关文章

随机推荐