...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::compute::flat_map
// In header: <boost/compute/container/flat_map.hpp> template<typename Key, typename T> class flat_map { public: // types typedef Key key_type; typedef T mapped_type; typedef ::boost::compute::vector< std::pair< Key, T > > vector_type; typedef vector_type::value_type value_type; typedef vector_type::size_type size_type; typedef vector_type::difference_type difference_type; typedef vector_type::reference reference; typedef vector_type::const_reference const_reference; typedef vector_type::pointer pointer; typedef vector_type::const_pointer const_pointer; typedef vector_type::iterator iterator; typedef vector_type::const_iterator const_iterator; typedef vector_type::reverse_iterator reverse_iterator; typedef vector_type::const_reverse_iterator const_reverse_iterator; // construct/copy/destruct explicit flat_map(const context & = system::default_context()); flat_map(const flat_map< Key, T > &); flat_map< Key, T > & operator=(const flat_map< Key, T > &); ~flat_map(); // public member functions iterator begin(); const_iterator begin() const; const_iterator cbegin() const; iterator end(); const_iterator end() const; const_iterator cend() const; reverse_iterator rbegin(); const_reverse_iterator rbegin() const; const_reverse_iterator crbegin() const; reverse_iterator rend(); const_reverse_iterator rend() const; const_reverse_iterator crend() const; size_type size() const; size_type max_size() const; bool empty() const; size_type capacity() const; void reserve(size_type, command_queue &); void reserve(size_type); void shrink_to_fit(); void clear(); std::pair< iterator, bool > insert(const value_type &, command_queue &); std::pair< iterator, bool > insert(const value_type &); iterator erase(const const_iterator &, command_queue &); iterator erase(const const_iterator &); iterator erase(const const_iterator &, const const_iterator &, command_queue &); iterator erase(const const_iterator &, const const_iterator &); size_type erase(const key_type &, command_queue &); iterator find(const key_type &, command_queue &); iterator find(const key_type &); const_iterator find(const key_type &, command_queue &) const; const_iterator find(const key_type &) const; size_type count(const key_type &, command_queue &) const; size_type count(const key_type &) const; iterator lower_bound(const key_type &, command_queue &); iterator lower_bound(const key_type &); const_iterator lower_bound(const key_type &, command_queue &) const; const_iterator lower_bound(const key_type &) const; iterator upper_bound(const key_type &, command_queue &); iterator upper_bound(const key_type &); const_iterator upper_bound(const key_type &, command_queue &) const; const_iterator upper_bound(const key_type &) const; const mapped_type at(const key_type &) const; unspecified operator[](const key_type &); };
flat_map
public member functionsiterator begin();
const_iterator begin() const;
const_iterator cbegin() const;
iterator end();
const_iterator end() const;
const_iterator cend() const;
reverse_iterator rbegin();
const_reverse_iterator rbegin() const;
const_reverse_iterator crbegin() const;
reverse_iterator rend();
const_reverse_iterator rend() const;
const_reverse_iterator crend() const;
size_type size() const;
size_type max_size() const;
bool empty() const;
size_type capacity() const;
void reserve(size_type size, command_queue & queue);
void reserve(size_type size);
void shrink_to_fit();
void clear();
std::pair< iterator, bool > insert(const value_type & value, command_queue & queue);
std::pair< iterator, bool > insert(const value_type & value);
iterator erase(const const_iterator & position, command_queue & queue);
iterator erase(const const_iterator & position);
iterator erase(const const_iterator & first, const const_iterator & last, command_queue & queue);
iterator erase(const const_iterator & first, const const_iterator & last);
size_type erase(const key_type & value, command_queue & queue);
iterator find(const key_type & value, command_queue & queue);
iterator find(const key_type & value);
const_iterator find(const key_type & value, command_queue & queue) const;
const_iterator find(const key_type & value) const;
size_type count(const key_type & value, command_queue & queue) const;
size_type count(const key_type & value) const;
iterator lower_bound(const key_type & value, command_queue & queue);
iterator lower_bound(const key_type & value);
const_iterator lower_bound(const key_type & value, command_queue & queue) const;
const_iterator lower_bound(const key_type & value) const;
iterator upper_bound(const key_type & value, command_queue & queue);
iterator upper_bound(const key_type & value);
const_iterator upper_bound(const key_type & value, command_queue & queue) const;
const_iterator upper_bound(const key_type & value) const;
const mapped_type at(const key_type & key) const;
unspecified operator[](const key_type & key);