kblib
0.2.3
General utilities library for modern C++
trie.cpp
Go to the documentation of this file.
1
#include "
kblib/trie.h
"
2
3
#if KBLIB_USE_CXX17
4
5
# include "catch.hpp"
6
7
# include <string>
8
9
TEST_CASE
(
"trie"
) {
10
KBLIB_UNUSED
auto
test
=
kblib::trie<std::string, int>
{};
11
static_assert
(std::is_same<kblib::indexer_extractor<std::string>,
12
kblib::default_extractor_t<std::string>
>::value,
13
"default_extractor<std::string> is indexer"
);
14
static_assert
(
kblib::extractor_policy_for<std::string>::value
15
==
kblib::extractor_policy::random_access
,
16
"std::string is a random access container"
);
17
static_assert
(
18
std::is_same<typename kblib::indexer_extractor<std::string>::value_type,
19
char
>::value,
20
"value_type of std::string is char"
);
21
KBLIB_UNUSED
auto
test2 =
kblib::trie<char, int>
{};
22
KBLIB_UNUSED
auto
test3 =
kblib::trie<char[], int>
{};
23
}
24
25
#endif
kblib::trie
Definition:
trie.h:100
test
constexpr auto test() noexcept -> bool
Definition:
main.cpp:68
kblib::default_extractor_t
typename std::conditional< extractor_policy_for< Container >::value==extractor_policy::random_access, indexer_extractor< Container >, iterator_extractor< Container > >::type default_extractor_t
Definition:
trie.h:88
kblib::extractor_policy::random_access
@ random_access
kblib::extractor_policy_for
Definition:
trie.h:74
KBLIB_UNUSED
#define KBLIB_UNUSED
This internal macro is used to provide a fallback for [[maybe_unused]] in C++14.
Definition:
tdecl.h:130
TEST_CASE
TEST_CASE("trie")
Definition:
trie.cpp:9
trie.h
Provides the trie data structure.
tests
trie.cpp
Generated by
1.9.4