UFO
1.0.0
An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
Loading...
Searching...
No Matches
filter.hpp
1
42
#ifndef UFO_CONTAINER_TREE_PREDICATE_FILTER_HPP
43
#define UFO_CONTAINER_TREE_PREDICATE_FILTER_HPP
44
45
// STL
46
#include <type_traits>
47
48
namespace
ufo::pred
49
{
50
template
<
class
Predicate>
51
struct
Filter
{
52
static_assert
(
false
,
"Predicate not implemented correctly."
);
53
};
54
55
//
56
// Contains predicate
57
//
58
59
namespace
detail
60
{
61
template
<
class
,
class
>
62
struct
contains_pred
: std::false_type {
63
};
64
65
template
<
class
T>
66
struct
contains_pred
<T, T> : std::true_type {
67
};
68
69
template
<
class
,
class
>
70
struct
contains_always_pred
: std::false_type {
71
};
72
73
template
<
class
T>
74
struct
contains_always_pred
<T, T> : std::true_type {
75
};
76
}
// namespace detail
77
78
template
<
class
Pred,
class
Preds>
79
constexpr
inline
bool
contains_pred_v =
detail::contains_pred<Pred, Preds>::value
;
80
81
template
<
class
Pred,
class
Preds>
82
constexpr
inline
bool
contains_always_pred_v =
83
detail::contains_always_pred<Pred, Preds>::value
;
84
85
//
86
// Predicate concept
87
//
88
89
template
<
class
T>
90
concept
Filterable
=
requires
{
typename
Filter<T>; };
91
92
}
// namespace ufo::pred
93
94
#endif
// UFO_CONTAINER_TREE_PREDICATE_FILTER_HPP
ufo::pred::Filterable
Definition
filter.hpp:90
ufo::pred
Definition
predicate.hpp:74
ufo::pred::Filter
Definition
filter.hpp:51
ufo::pred::detail::contains_always_pred
Definition
filter.hpp:70
ufo::pred::detail::contains_pred
Definition
filter.hpp:62
lib
container
include
ufo
container
tree
predicate
filter.hpp
Generated by
1.9.8