Skip to content

Commit

Permalink
Rename proj
Browse files Browse the repository at this point in the history
  • Loading branch information
TartanLlama committed Dec 9, 2024
1 parent 85c6bb3 commit cf4834e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/tl/functional/predicates.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define TL_RANGES_PREDICATES_HPP

namespace tl {
inline constexpr auto proj = [](auto&& f, auto&& p) {
inline constexpr auto compose = [](auto&& f, auto&& p) {
return [f = std::forward<decltype(f)>(f), p = std::forward<decltype(p)>(p)](auto&&... args) {
return std::invoke(f, std::invoke(p, std::forward<decltype(args)>(args)...));
};
Expand Down
4 changes: 2 additions & 2 deletions tests/predicates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ TEST_CASE("negation") {
REQUIRE_FALSE(n(4));
}

TEST_CASE("proj") {
auto p = tl::proj([](int x) { return x + 1; }, [](int x) { return x + 2; });
TEST_CASE("compose") {
auto p = tl::compose([](int x) { return x + 1; }, [](int x) { return x + 2; });
REQUIRE(p(1) == 4);
REQUIRE(p(2) == 5);
REQUIRE(p(3) == 6);
Expand Down

0 comments on commit cf4834e

Please sign in to comment.