-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhas_find.hpp
More file actions
48 lines (32 loc) · 1.23 KB
/
has_find.hpp
File metadata and controls
48 lines (32 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#pragma once
#include <type_traits>
#include <map>
#include <unordered_map>
namespace mad {
namespace cppin {
// Has a template for collection member function find?
template<template<typename...> class TCollection>
struct template_has_member_find : std::false_type {};
template<>
struct template_has_member_find<std::set> : std::true_type {};
template<>
struct template_has_member_find<std::multiset> : std::true_type {};
template<>
struct template_has_member_find<std::map> : std::true_type {};
template<>
struct template_has_member_find<std::multimap> : std::true_type {};
template<>
struct template_has_member_find<std::unordered_set> : std::true_type {};
template<>
struct template_has_member_find<std::unordered_multiset> : std::true_type {};
template<>
struct template_has_member_find<std::unordered_map> : std::true_type {};
template<>
struct template_has_member_find<std::unordered_multimap> : std::true_type {};
// Has a concrete type member function find?
template<typename Collection, typename... Args>
struct has_member_find : public std::false_type {};
template<template<typename...> class Collection, typename... Args>
struct has_member_find<Collection<Args...>> : template_has_member_find <Collection> {};
} // cppin
} // mad