41 #ifndef DTK_PREDICATECOMPOSITION_IMPL_HPP 42 #define DTK_PREDICATECOMPOSITION_IMPL_HPP 51 template <
class ValueType>
52 PredicateComposition::Predicate<ValueType>
53 PredicateComposition::And(
const Predicate<ValueType> &func_left,
54 const Predicate<ValueType> &func_right )
56 return std::bind( std::logical_and<bool>(),
57 std::bind( func_left, std::placeholders::_1 ),
58 std::bind( func_right, std::placeholders::_1 ) );
63 template <
class ValueType>
64 PredicateComposition::Predicate<ValueType>
65 PredicateComposition::Or(
const Predicate<ValueType> &func_left,
66 const Predicate<ValueType> &func_right )
68 return std::bind( std::logical_or<bool>(),
69 std::bind( func_left, std::placeholders::_1 ),
70 std::bind( func_right, std::placeholders::_1 ) );
76 template <
class ValueType>
77 PredicateComposition::Predicate<ValueType>
78 PredicateComposition::Not(
const Predicate<ValueType> &func )
80 return std::bind( std::logical_not<bool>(),
81 std::bind( func, std::placeholders::_1 ) );
86 template <
class ValueType>
87 PredicateComposition::Predicate<ValueType>
88 PredicateComposition::AndNot(
const Predicate<ValueType> &func_left,
89 const Predicate<ValueType> &func_right )
91 return std::bind( std::logical_and<bool>(),
92 std::bind( func_left, std::placeholders::_1 ),
93 std::bind( Not( func_right ), std::placeholders::_1 ) );
98 template <
class ValueType>
99 PredicateComposition::Predicate<ValueType>
100 PredicateComposition::OrNot(
const Predicate<ValueType> &func_left,
101 const Predicate<ValueType> &func_right )
103 return std::bind( std::logical_or<bool>(),
104 std::bind( func_left, std::placeholders::_1 ),
105 std::bind( Not( func_right ), std::placeholders::_1 ) );
112 #endif // end DTK_PREDICATECOMPOSITION_IMPL_HPP