Closed godexsoft closed 8 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
34da4a2
) to head (2137ca7
). Report is 44 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@godexsoft do you mind keeping the is_p
and is_e
tests in filter.cpp
separate ? They do not work the same; error generator is a sink, but predicate is not (it can only read a value) and keeping these mixed creates confusing impression that they work the same. While doing so you might add more tests to is_p
to see it in practice (no matter the type of operand, predicate won't bind a non-const lvalue-ref or rvalue-ref, but error generator will)
Also, the "// lvalue operand
" comments are misleading when the operand type has no &
qualifier. These are prvalues, not lvalues. In case of binding to predicates parameter, we turn these to const lvalue (by means of std::as_const
) , but predicate in filter
(and also inspect
) are unusual, since they are not sinks. Normal monadic operations are sinks and they would receive parameter as-is (which is what we use FWD(v)
for, or someone else would write a little slower to compile and longer to type std::forward<decltype(v)>(v)
)
Also, the "
// lvalue operand
" comments are misleading when the operand type has no&
qualifier. These are prvalues, not lvalues. In case of binding to predicates parameter, we turn these to const lvalue (by means ofstd::as_const
) , but predicate infilter
(and alsoinspect
) are unusual, since they are not sinks. Normal monadic operations are sinks and they would receive parameter as-is (which is what we useFWD(v)
for, or someone else would write a little slower to compile and longer to typestd::forward<decltype(v)>(v)
)
That's a good observation. I will update accordingly.
Fixes #23
All tests are now using static_check util. Not 100% sure about removing the few places we had clang-format disabled. It's not too bad as it is now but arguably was a little nicer before.