2 #ifndef vbl_batch_compact_multimap_h_ 3 #define vbl_batch_compact_multimap_h_ 17 # include <vcl_msvc_warnings.h> 26 template <
typename K,
typename T,
typename C=std::less<K> >
33 typedef typename std::pair<key_type, value_type>
input_type;
59 {
return comp(x.first, y.first); }
64 template <
typename CI>
73 template <
typename CI>
83 template <
typename CI>
90 while (start != finish)
92 typename std::iterator_traits<CI>::value_type::first_type
const & last_start_val = start->first;
93 keys_.push_back(start->first);
95 values_.push_back(start->second);
96 while(++start != finish && start->first == last_start_val)
98 values_.push_back(start->second);
159 if (k_it ==
keys_end() || *k_it != x)
162 return std::make_pair(v_it, v_it);
177 if (k_it ==
keys_end() || *k_it != x)
189 if (k_it ==
keys_end() || *k_it != x)
200 template <
typename CI,
typename CMP>
203 if (start == end)
return true;
205 for (--end; start!=end; ++start)
208 if (comp(*(start+1), *start))
return false;
214 template<
typename K,
typename T,
typename C>
220 #endif // vbl_batch_compact_multimap_h_ vbl_batch_compact_multimap()=default
bool is_sorted(CI start, CI end, CMP comp)
void swap(vbl_batch_compact_multimap &x)
std::vector< value_type > value_container_type
bool operator==(const vbl_batch_compact_multimap &rhs)
void assign(CI start, CI finish)
Change all the values in the multimap.
std::vector< key_type > key_container_type
std::pair< key_type, value_type > input_type
The type of data in the inputted sequence.
const_value_iterator lower_bound(const key_type &x) const
Finds the beginning of a subsequence of values whose key matches given x.
vbl_batch_compact_multimap(CI start, CI finish)
std::pair< const_value_iterator, const_value_iterator > equal_range(const key_type &x) const
A more efficient make_pair(lower_bound(...), upper_bound(...)).
const_key_iterator keys_begin() const
const_value_iterator values_begin() const
value_container_type values_
value_container_type::const_iterator const_value_iterator
std::vector< index_type > index_container_type
void assign_sorted(CI start, CI finish)
Change all the values in the multimap, to a ready sorted sequence.
A fast read and batch-write map-style collection.
std::size_t count(const key_type &x) const
Finds the number of values matching key x,.
const_value_iterator upper_bound(const key_type &x) const
Finds the one past the end of a subsequence of values whose key matches given x.
index_container_type indices_
const_key_iterator keys_end() const
void swap(vbl_batch_compact_multimap< K, T, C > &x, vbl_batch_compact_multimap< K, T, C > &y)
const_value_iterator find(const key_type &x) const
Finds the first value with key matching x, or returns values_end() if no match,.
key_container_type::const_iterator const_key_iterator
const_value_iterator values_end() const
std::vector< input_type > input_container_type
The type of container used internally to process inputted data.