Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _NODISCARD iterator find(const key_type& _Keyval)
- { // find an element in mutable hash table that matches _Keyval
- return (lower_bound(_Keyval));
- }
- _NODISCARD const_iterator find(const key_type& _Keyval) const
- { // find an element in nonmutable hash table that matches _Keyval
- return (lower_bound(_Keyval));
- }
- _NODISCARD size_type count(const key_type& _Keyval) const
- { // count all elements that match _Keyval
- _Paircc _Ans = equal_range(_Keyval);
- return (static_cast<size_type>(_STD distance(_Ans.first, _Ans.second)));
- }
- _NODISCARD iterator lower_bound(const key_type& _Keyval)
- { // find leftmost not less than _Keyval in mutable hash table
- size_type _Bucket = _Hashval(_Keyval);
- for (_Unchecked_iterator _Where = _Begin(_Bucket);
- _Where != _End(_Bucket); ++_Where)
- if (!_Traitsobj(_Traits::_Kfn(*_Where), _Keyval))
- return (_Traitsobj(_Keyval,
- _Traits::_Kfn(*_Where)) ? end() : _Make_iter(_Where));
- return (end());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement