template <class Iterator>
int distance_if_multipass(Iterator first, Iterator last) {
typedef typename std::iterator_traits<Iterator>::iterator_category categ;
- if (std::is_same<categ,std::input_iterator_tag>::value)
+ if (std::is_same<categ, std::input_iterator_tag>::value) {
return -1;
+ }
return std::distance(first, last);
}
iterator find(const key_type& key) {
iterator it = lower_bound(key);
- if (it == end() || !key_comp()(key, *it))
+ if (it == end() || !key_comp()(key, *it)) {
return it;
+ }
return end();
}
const_iterator find(const key_type& key) const {
const_iterator it = lower_bound(key);
- if (it == end() || !key_comp()(key, *it))
+ if (it == end() || !key_comp()(key, *it)) {
return it;
+ }
return end();
}
iterator find(const key_type& key) {
iterator it = lower_bound(key);
- if (it == end() || !key_comp()(key, it->first))
+ if (it == end() || !key_comp()(key, it->first)) {
return it;
+ }
return end();
}
const_iterator find(const key_type& key) const {
const_iterator it = lower_bound(key);
- if (it == end() || !key_comp()(key, it->first))
+ if (it == end() || !key_comp()(key, it->first)) {
return it;
+ }
return end();
}