Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class A
- {
- public:
- char * name;
- };
- template < class Key, class Compare = less<Key>,
- class Allocator = allocator<Key> > class set;
- template<typename _Key, typename _Val, typename _KeyOfValue,
- typename _Compare, typename _Alloc>
- typename _Rb_tree<_Key, _Val, _KeyOfValue,
- _Compare, _Alloc>::iterator
- _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
- find(const _Key& __k)
- {
- iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);
- return (__j == end()
- || _M_impl._M_key_compare(__k, _S_key(__j._M_node))) ? end() : __j;
- }
- struct comparator : std::binary_function<A,A,bool> {
- bool operator()( A const& lhs, A const& rhs ) const;
- };
- a == b <==> !(a < b) && !(b < a)
- set<Item*> itemSet;
- Item* item = new Item();
- if (itemSet.count(item) == 0)
- {
- std::cout<<"not found"
- }
- //or
- if (itemSet.find(item) == itemSet.end())
- {
- std::cout<<"not found"
- }
Add Comment
Please, Sign In to add comment