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
48namespace ufo::pred
49{
50template <class Predicate>
51struct Filter {
52 static_assert(false, "Predicate not implemented correctly.");
53};
54
55//
56// Contains predicate
57//
58
59namespace detail
60{
61template <class, class>
62struct contains_pred : std::false_type {
63};
64
65template <class T>
66struct contains_pred<T, T> : std::true_type {
67};
68
69template <class, class>
70struct contains_always_pred : std::false_type {
71};
72
73template <class T>
74struct contains_always_pred<T, T> : std::true_type {
75};
76} // namespace detail
77
78template <class Pred, class Preds>
79constexpr inline bool contains_pred_v = detail::contains_pred<Pred, Preds>::value;
80
81template <class Pred, class Preds>
82constexpr inline bool contains_always_pred_v =
84
85//
86// Predicate concept
87//
88
89template <class T>
90concept Filterable = requires { typename Filter<T>; };
91
92} // namespace ufo::pred
93
94#endif // UFO_CONTAINER_TREE_PREDICATE_FILTER_HPP