Skip to content

Commit

Permalink
Add requires to eval_object/target
Browse files Browse the repository at this point in the history
  • Loading branch information
Anilm3 committed Oct 2, 2024
1 parent b7fc7a5 commit 5db918a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/condition/scalar_condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ template <typename ResultType, typename Iterator>
ResultType eval_object(Iterator &it, std::string_view address, bool ephemeral,
const matcher::base &matcher, const std::span<const transformer_id> &transformers,
const object_limits &limits)
requires(std::is_same_v<ResultType, bool> ||
std::is_same_v<ResultType, std::optional<condition_match>>)
{
// The iterator is guaranteed to be valid at this point, which means the
// object pointer should not be nullptr
Expand Down Expand Up @@ -89,6 +91,8 @@ template <typename ResultType, typename Iterator>
ResultType eval_target(Iterator &it, std::string_view address, bool ephemeral,
const matcher::base &matcher, const std::span<const transformer_id> &transformers,
const object_limits &limits, ddwaf::timer &deadline)
requires(std::is_same_v<ResultType, bool> ||
std::is_same_v<ResultType, std::optional<condition_match>>)
{
for (; it; ++it) {
if (deadline.expired()) {
Expand Down

0 comments on commit 5db918a

Please sign in to comment.