Empirical
|
#include <ra_set.h>
Public Types | |
using | value_type = T |
Public Member Functions | |
ra_set () | |
ra_set (const ra_set &)=default | |
ra_set (ra_set &&)=default | |
ra_set< T > & | operator= (const ra_set &)=default |
ra_set< T > & | operator= (ra_set &&)=default |
bool | empty () const |
Are there any values in this ra_set? More... | |
size_t | size () const |
How many elements are in this set? More... | |
const T & | operator[] (size_t pos) const |
Index into the ra_set, similar to a vector. More... | |
void | clear () |
Remove all values from this container. More... | |
void | insert (const T &v) |
Insert a new value into container. More... | |
bool | erase (const T &v) |
Erase a specific value from the container. More... | |
size_t | count (const T &v) const |
Count the number of times a particular value in in the container (0 or 1). More... | |
This class uses a combination of a hashtable (std::unordered_map) and emp::vector to lookup insert, lookup, and delete values in constant time, while still being able to step through all values (albeit in an arbitrary order).
using emp::ra_set< T >::value_type = T |
|
inline |
|
default |
|
default |
|
inline |
Remove all values from this container.
|
inline |
Count the number of times a particular value in in the container (0 or 1).
|
inline |
Are there any values in this ra_set?
|
inline |
Erase a specific value from the container.
|
inline |
Insert a new value into container.
|
default |
|
default |
|
inline |
Index into the ra_set, similar to a vector.
|
inline |
How many elements are in this set?