C++ Logo

std-proposals

Advanced search

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

From: v.S. F. <de34_at_[hidden]>
Date: Wed, 4 May 2022 04:05:27 +0000
AFAIK this feature has been in C++20 and implemented.

[C++] clang 14.0.0 - Wandbox<https://wandbox.org/permlink/odPnEY4bOxTbKtx3>

[expr.prim.lambda.general]/3<https://timsong-cpp.github.io/cppwp/n4868/expr.prim.lambda.general#3>

Yours,
Jiang An
________________________________
发件人: Std-Proposals <std-proposals-bounces_at_[hidden]socpp.org> 代表 R. Kagirov via Std-Proposals <std-proposals_at_[hidden]>
发送时间: 2022年5月4日 8:25
收件人: std-proposals_at_[hidden] <std-proposals_at_[hidden]>
抄送: R. Kagirov <rishatk87_at_[hidden]>
主题: [std-proposals] Allow usage "consteval" in lambda-functions

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
--
Std-Proposals mailing list
Std-Proposals_at_[hidden]
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2022-05-04 04:05:32