GCC Code Coverage Report


Directory: src/
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 20.0% 2 / 0 / 10
Functions: -% 0 / 0 / 0
Branches: -% 0 / 0 / 0

reverse_comparator.hpp
Line Branch Exec Source
1 #pragma once
2
3 #include <functional>
4 #include <utility>
5
6 namespace wala {
7
8 template <typename F> struct reverse_comparator_t {
9 F f;
10 40 template <typename Arg1, typename Arg2> constexpr bool operator() (Arg1&& arg1, Arg2&& arg2) & {
11 40 return f(std::forward<Arg2>(arg2), std::forward<Arg1>(arg1));
12 }
13 ✗ template <typename Arg1, typename Arg2> constexpr bool operator() (Arg1&& arg1, Arg2&& arg2) const& {
14 ✗ return f(std::forward<Arg2>(arg2), std::forward<Arg1>(arg1));
15 }
16 ✗ template <typename Arg1, typename Arg2> constexpr bool operator() (Arg1&& arg1, Arg2&& arg2) && {
17 ✗ return std::move(f)(std::forward<Arg2>(arg2), std::forward<Arg1>(arg1));
18 }
19 ✗ template <typename Arg1, typename Arg2> constexpr bool operator() (Arg1&& arg1, Arg2&& arg2) const&& {
20 ✗ return std::move(f)(std::forward<Arg2>(arg2), std::forward<Arg1>(arg1));
21 }
22 };
23
24 ✗ template <typename F> constexpr reverse_comparator_t<std::decay_t<F>> reverse_comparator(F&& f) {
25 ✗ return { std::forward<F>(f) };
26 }
27
28 } // namespace wala
29