kblib 0.2.3
General utilities library for modern C++
intrusive_containers.cpp
Go to the documentation of this file.
2
3#include <string>
4
5#include "catch.hpp"
6
7#if KBLIB_USE_CXX17
8
9struct example {
10 int first;
11 int second;
12 std::string payload;
13};
14
15TEST_CASE("intrusive_map") {
17 X a;
18 const X b{};
19 static_assert(std::is_same_v<X::key_type, int>);
20 static_assert(std::is_same_v<X::mapped_type, example>);
21 static_assert(std::is_same_v<X::value_type, example>);
22 static_assert(std::is_same_v<X::hasher, kblib::FNV_hash<>>);
23 static_assert(std::is_same_v<X::key_equal, std::equal_to<>>);
24}
25
26TEST_CASE("intrusive_dual_map") {
28}
29
30#endif
TEST_CASE("intrusive_map")
Provides map types which directly use the members of the value type to create the map structure.
auto map(F f, T &&... t) noexcept(noexcept(std::tuple{ kblib::apply(f, std::forward< T >(t))...})) -> enable_if_t< not any_void< decltype(kblib::apply(f, std::forward< T >(t)))... >, decltype(std::tuple{kblib::apply(f, std::forward< T >(t))...})>
Definition: simple.h:75
constexpr auto a(const std::initializer_list< T > &a) -> auto
Index an array literal without naming its type.
Definition: simple.h:255
std::string payload