74 static constexpr void init(
Pred& p,
Tree const& t)
noexcept
79 for (
int d{}; d < num; ++d) {
81 if (p.min >= l && p.max >= l) {
82 min_d = -1 == min_d ? d : min_d;
87 if (min_d > 0 && max_d > 0) {
93 if constexpr (Negated) {
94 p.min_depth = std::numeric_limits<int>::lowest();
95 p.max_depth = std::numeric_limits<int>::max();
97 p.min_depth = std::numeric_limits<int>::max();
98 p.max_depth = std::numeric_limits<int>::lowest();
102 template <
class Value>
103 [[nodiscard]]
static constexpr bool returnableValue(
Pred const&, Value
const&)
noexcept
108 template <
class Tree>
109 [[nodiscard]]
static constexpr bool returnable(
Pred const& p,
Tree const& t,
113 int depth =
static_cast<int>(t.
depth(n));
114 if constexpr (Negated) {
115 return p.min_depth > depth || p.max_depth < depth;
117 return p.min_depth <= depth && p.max_depth >= depth;
121 template <
class Tree>
122 [[nodiscard]]
static constexpr bool traversable(
Pred const& p,
Tree const& t,
126 int depth =
static_cast<int>(t.
depth(n));
127 if constexpr (Negated) {
128 return 0 < p.min_depth || p.max_depth + 1 < depth;
130 return p.min_depth < depth;
134 template <
class Tree>
135 [[nodiscard]]
static constexpr bool returnableRay(
Pred const& p,
Tree const& t,
139 return returnable(p, t, n);
142 template <
class Tree>
143 [[nodiscard]]
static constexpr bool traversableRay(
Pred const& p,
Tree const& t,
147 return traversable(p, t, n);