52template <
typename Container>
55 typename std::remove_cv<
typename std::remove_reference<
decltype(
56 *begin(std::declval<Container&>()))>::type>::type;
59template <
typename Container>
62 typename std::remove_cv<
typename std::remove_reference<
decltype(
63 std::declval<Container&>()[0])>::type>::type;
65 template <
typename index_type>
67 Container&& c, index_type index)
noexcept(
noexcept(c[index]))
73template <
typename Container,
typename =
void>
76 = extractor_policy::forward_iteration;
79template <
typename Container>
81 void_t<decltype(
std::declval<Container>()[0])>> {
85template <
typename Container>
92 template <
typename Elem,
typename Value>
97template <
typename Key,
typename T,
121 std::unique_ptr<node_type> root;
126template <
typename KeyElem,
typename T,
typename Extractor>
127class trie<KeyElem, T, Extractor, false> {};
129template <
typename KeyElem,
typename T,
typename Extractor>
130class trie<KeyElem[], T, Extractor, false> {};
139template <
typename Key,
typename =
void>
142template <
typename Key>
146 "Key too large to index array");
150 static_assert(std::is_integral<value_type>::value,
151 "Key elements must be integral");
154 noexcept(key.begin())) ->
decltype(
auto) {
158 noexcept(key.end())) ->
decltype(
auto) {
162 Key& key, std::size_t idx)
noexcept(
noexcept(key[idx]))
168template <
typename KeyElem>
172 "Key too large to index array");
176 static_assert(std::is_integral<value_type>::value,
177 "Key elements must be integral");
179 template <std::
size_t Size>
181 noexcept(std::begin(key))) ->
decltype(
auto) {
182 return std::begin(key);
184 template <std::
size_t Size>
186 noexcept(std::end(key))) ->
decltype(
auto) {
187 return std::end(key);
189 template <std::
size_t Size>
191 KeyElem (&key)[Size], std::size_t idx)
noexcept(
noexcept(key[idx]))
197template <
typename Key>
205template <
typename Key,
typename Extractor = default_extract<Key>,
206 typename offset_type = std::ptrdiff_t>
222 = extractor::key_cardinality;
227 using row_type = std::pair<std::bitset<key_elem_cardinality>,
228 std::array<offset_type, key_elem_cardinality>>;
229 std::vector<row_type> data_;
232template <
typename Key,
typename Extractor = default_extract<Key>,
233 typename offset_type = std::ptrdiff_t>
249 = extractor::key_cardinality;
253 using row_type = std::array<std::pair<std::optional<Key>, offset_type>,
254 key_elem_cardinality>;
255 std::vector<row_type> data_;
258template <
typename Key,
typename Value,
260 typename offset_type = std::ptrdiff_t,
261 template <
typename>
typename SequenceContainer = std::vector>
263template <
typename Key,
typename Value,
265 typename offset_type = std::ptrdiff_t,
266 template <
typename>
typename SequenceContainer = std::vector>
269template <
typename Key,
typename Extractor = default_extract<Key>>
272template <
typename Key,
typename Value,
const value_type & const_reference
typename extractor::value_type key_elem
std::ptrdiff_t difference_type
const value_type * const_pointer
const value_type & const_reference
const value_type * const_pointer
std::ptrdiff_t difference_type
typename extractor::value_type key_elem
std::reverse_iterator< const_iterator > const_reverse_iterator
std::reverse_iterator< iterator > reverse_iterator
const T & const_reference
std::ptrdiff_t difference_type
std::pair< key_type, mapped_type > value_type
typename make_void< Ts... >::type void_t
constexpr struct kblib::nums::max_t max
typename std::conditional< extractor_policy_for< Container >::value==extractor_policy::random_access, indexer_extractor< Container >, iterator_extractor< Container > >::type default_extractor_t
typename void_if< b >::type void_if_t
constexpr bool is_radix_sortable_v
{WIP} Provides a fast and generic sorting interface.
Provides macros and basic templates used by the rest of kblib.
#define KBLIB_NODISCARD
This internal macro is used to provide a fallback for [[nodiscard]] in C++14.
Contains some type traits not in the standard library that are useful in the implementation of kblib.