GCC Code Coverage Report


Directory: src/
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 79.3% 23 / 0 / 29
Functions: 66.7% 10 / 0 / 15
Branches: 33.3% 1 / 0 / 3

yc.hpp
Line Branch Exec Source
1 #pragma once
2
3 #include <functional>
4 #include <utility>
5
6 namespace std {
7
8 template <class Fun>
9 class y_combinator_result {
10 Fun fun_;
11
12 public:
13 template <class T>
14 92 explicit y_combinator_result(T &&fun): fun_(std::forward<T>(fun)) {}
15
16 template <class ...Args>
17 33675384 decltype(auto) operator()(Args &&...args) {
18
1/3
None:
✓ Branch 16 → 17 taken 21 times.
decltype(auto) std::y_combinator_result<wala::static_forest_t::static_forest_t(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, std::vector<int, std::allocator<int> > const&)::{lambda(int)#1}::operator()(int) const::{lambda(auto:1&&, int, int, int, int, bool)#1}>::operator()<int&, int&, int&, int, bool>(int&, int&, int&, int&&, bool&&):
✗ Branch 13 → 14 not taken.
decltype(auto) std::y_combinator_result<wala::static_forest_t::static_forest_t(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, std::vector<int, std::allocator<int> > const&)::{lambda(int)#1}::operator()(int) const::{lambda(auto:1&&, int, int, int, int, bool)#1}>::operator()<int&, int, int, int, bool>(int&, int&&, int&&, int&&, bool&&):
✗ Branch 13 → 14 not taken.
33675384 return fun_(std::ref(*this), std::forward<Args>(args)...);
19 }
20 };
21
22 template <class Fun>
23 92 decltype(auto) y_combinator(Fun &&fun) {
24 92 return y_combinator_result<std::decay_t<Fun>>(std::forward<Fun>(fun));
25 }
26
27 } // namespace std
28