C++ Logo

std-proposals

Advanced search

[std-proposals] Allow usage "consteval" in lambda-functions

From: R. Kagirov <rishatk87_at_[hidden]>
Date: Wed, 4 May 2022 03:25:42 +0300
Hi everyone!
I suggest allowing the use of "consteval" in lambda functions as well
as the use of "constexpr" in C++20.

=== EXAMPLE ===
// ...
const int x = 3;
auto lambda = [=]()
    consteval -> int
    {
        return 1<<x;
    };
std::cout << lambda();
// ...

Best regards,
Rishat D. Kagirov

Received on 2022-05-04 00:25:54