20 #ifndef LIBMESH_VECTORMAP_H 21 #define LIBMESH_VECTORMAP_H 60 template <
typename Key,
typename Tp>
61 class vectormap :
public std::vector<std::pair<Key, Tp>>
71 typedef typename vector_type::iterator
iterator;
83 {
return lhs.first < rhs.first; }
93 {
return lhs.first == rhs.first; }
109 std::vector<
std::pair<Key, Tp>> (other),
149 if (lower_bound == this->
end() || lower_bound->first != key)
150 libmesh_error_msg(
"Error in vectormap::operator[], key not found. " 151 "If you are searching for values you aren't sure exist, try vectormap::find() instead.");
153 return lower_bound->second;
173 if (lb == this->
end() || lb->first != key)
198 if (lb == this->
end() || lb->first != key)
223 if (lb == this->
end() || lb->first != key)
237 #endif // LIBMESH_VECTORMAP_H iterator find(const key_type &key)
std::vector< value_type > vector_type
std::pair< Key, Tp > value_type
vector_type::const_iterator const_iterator
void insert(const value_type &x)
vectormap(const vectormap< Key, Tp > &other)
difference_type count(const key_type &key) const
bool operator()(const value_type &lhs, const value_type &rhs) const
const_iterator find(const key_type &key) const
bool operator()(const value_type &lhs, const value_type &rhs) const
vector_type::difference_type difference_type
vector_type::iterator iterator
const Tp & operator[](const key_type &key) const