From ac45c34c705dc2114d1155b66545d2b3a7ed5613 Mon Sep 17 00:00:00 2001 From: Gryfenfer97 Date: Sat, 1 Feb 2025 19:59:12 +0100 Subject: transform pred in a lambda function --- languages/c/c++/lambda-core.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'languages/c') diff --git a/languages/c/c++/lambda-core.cpp b/languages/c/c++/lambda-core.cpp index a6ce614..c9e73b9 100644 --- a/languages/c/c++/lambda-core.cpp +++ b/languages/c/c++/lambda-core.cpp @@ -39,7 +39,7 @@ constexpr auto succ = [](const auto &n) { constexpr auto one = succ(zero); -constexpr auto pred(const auto &n) { +constexpr auto pred = [](const auto &n) { return [&n](const auto &f) { return [&n, &f](auto x) { return n([&f](const auto &g) { @@ -47,7 +47,7 @@ constexpr auto pred(const auto &n) { })([x](const auto &u) { return x; })([](const auto &a) { return a; }); }; }; -} +}; namespace test { constexpr unsigned int convert(const auto &n) { -- cgit v1.2.3