libhatchet
Loading...
Searching...
No Matches
hxflat_set.hpp File Reference

Go to the source code of this file.

Classes

class  hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >

Functions

template<typename key_t_, typename compare_t_, bool multi_t_, hxsize_t capacity_x_, hxsize_t capacity_y_>
bool hxkey_equal (const hxflat_set< key_t_, compare_t_, multi_t_, capacity_x_ > &x_, const hxflat_set< key_t_, compare_t_, multi_t_, capacity_y_ > &y_)
template<typename key_t_, typename compare_t_, bool multi_t_, hxsize_t capacity_x_, hxsize_t capacity_y_>
bool hxkey_less (const hxflat_set< key_t_, compare_t_, multi_t_, capacity_x_ > &x_, const hxflat_set< key_t_, compare_t_, multi_t_, capacity_y_ > &y_)
template<typename key_t_, typename compare_t_, bool multi_t_>
void hxswap (hxflat_set< key_t_, compare_t_, multi_t_, hxallocator_dynamic_capacity > &x_, hxflat_set< key_t_, compare_t_, multi_t_, hxallocator_dynamic_capacity > &y_) noexcept

Detailed Description

A sorted flat set and multiset backed by an array of keys.

Function Documentation

◆ hxkey_equal()

template<typename key_t_, typename compare_t_, bool multi_t_, hxsize_t capacity_x_, hxsize_t capacity_y_>
bool hxkey_equal ( const hxflat_set< key_t_, compare_t_, multi_t_, capacity_x_ > & x_,
const hxflat_set< key_t_, compare_t_, multi_t_, capacity_y_ > & y_ )
inline

bool hxkey_equal(hxflat_set<K>& x, hxflat_set<K>& y) - Compares the contents of x and y for equivalence.

◆ hxkey_less()

template<typename key_t_, typename compare_t_, bool multi_t_, hxsize_t capacity_x_, hxsize_t capacity_y_>
bool hxkey_less ( const hxflat_set< key_t_, compare_t_, multi_t_, capacity_x_ > & x_,
const hxflat_set< key_t_, compare_t_, multi_t_, capacity_y_ > & y_ )
inline

bool hxkey_less(hxflat_set<K>& x, hxflat_set<K>& y) - Compares the contents of x and y lexicographically using hxkey_equal and hxkey_less on each element.

◆ hxswap()

template<typename key_t_, typename compare_t_, bool multi_t_>
void hxswap ( hxflat_set< key_t_, compare_t_, multi_t_, hxallocator_dynamic_capacity > & x_,
hxflat_set< key_t_, compare_t_, multi_t_, hxallocator_dynamic_capacity > & y_ )
inlinenoexcept

void hxswap(hxflat_set<K>& x, hxflat_set<K>& y) - Exchanges the contents of x and y.

Only works with hxallocator_dynamic_capacity. Dynamically allocated arrays are swapped with very little overhead.