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}
#define TEST(name)
Main namespace for Aleph-w library functions.
Definition ah-arena.H:89
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
std::decay_t< typename HeadC::Item_Type > T
Definition ah-zip.H:105
STL namespace.