Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
hash_restriction_test.cc
Go to the documentation of this file.
1
2#include <gtest/gtest.h>
3#include <hash-fct.H>
4#include <string>
5#include <type_traits>
6#include <utility>
7#include <vector>
8
9using namespace Aleph;
10
11// This test doesn't actually run anything, it just checks for compilation
12// behavior (via type traits and decltype if needed, but here we can just
13// use a compile-time check for the existence of the overload)
14
15template<typename T, typename = void>
16struct is_hashable : std::false_type {};
17
18template<typename T>
19struct is_hashable<T, std::void_t<decltype(fnv_hash(std::declval<T>()))>> : std::true_type {};
20
29
31{
32 // std::vector is NOT trivially copyable
33 EXPECT_FALSE(is_hashable<std::vector<int>>::value);
34}
35
37{
38 // std::string is NOT trivially copyable, but has a special overload
40
41 // const char* is a pointer (trivially copyable) and has overloads
43}
size_t size_t int32_t value
Definition ca-c-api.h:116
#define TEST(name)
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Definition Blossom.H:466
Standard hash functions for Aleph types.
Main namespace for Aleph-w library functions.
Definition ah-arena.H:89
std::decay_t< typename HeadC::Item_Type > T
Definition ah-zip.H:105
STL namespace.