|
template <class T, class HashFn = StdHash<T> >
class Index : private MoveableAndDeepCopyOption< Index<T, HashFn > >, public AIndex<T, Vector<T>, HashFn>
|
HashFn |
Hashing class. Must have unsigned operator()(const T& x) method defined, returning hash value for elements. Defaults to StdHash<T> which requires unsigned GetHashValue(const T&) function returning hash value of elements to be defined. |
Vector flavor of index. Inherits most of its functionality from AIndex and adds only members specific for its flavor.
Like any other NTL container, Index is a moveable type with pick and optional deep copy transfer semantics. Calling methods of picked Index is logic error with exception of
void operator=(pick_ Index& v) (defined by composition)
void operator<<=(const AIndex& v) (defined in AIndex)
void Clear()
bool IsPicked() const
Optional deep copy operator is inherited from AIndex class. Pick operator is implicitly defined by composition.
Base class
AIndex<T, Vector<T>, HashFn>
Index()
Constructs empty Index.
Index(pick_ Index& s)
Pick constructor. Transfers source Index in low constant time, but destroys it by picking.
Index(pick_ Vector<T>& s)
Pick operator. Transfers source Vector to Index in low constant time, but destroys it by picking.
Index(const Index& s, int)
Optional deep copy constructor.
Requires T to have deep copy constructor or optional deep copy constructor.
Index(const Vector<T>& s, int)
Deep-copy constructs Index from Vector.
Requires T to have deep copy constructor or optional deep copy constructor.
T Pop()
Drops last element of the Index and returns its value.
Requires T to have deep copy constructor.
|
Return value |
Value of the dropped element. |
Index& operator=(pick_ Vector<T>& x)
Pick operator. Transfers source Vector to Index in low constant time, but destroys it by picking.
|