C++ Logo

std-discussion

Advanced search

回复: 回复: 回复: 回复: Compile-time Variables and Stateful Meta-programming / STMP

From: SD SH <Z5515zwy_at_[hidden]>
Date: Tue, 15 Jul 2025 05:28:18 +0000
>We already have something that solve this: "constinit"
No. The change will be delayed until runtime. It's useless for the described case.
________________________________
发件人: Std-Discussion <std-discussion-bounces_at_lists.isocpp.org> 代表 Julien Villemure-Fréchette via Std-Discussion <std-discussion_at_[hidden]>
发送时间: 2025年7月15日 5:29
收件人: std-discussion_at_[hidden] <std-discussion_at_[hidden]>
抄送: Julien Villemure-Fréchette <julien.villemure_at_[hidden]>
主题: Re: [std-discussion] 回复: 回复: 回复: Compile-time Variables and Stateful Meta-programming / STMP

> There is a new idea: execute code after compiling, before running, called pre-execution.

We already have something that solve this: "constinit"


On July 14, 2025 4:14:00 a.m. EDT, SD SH via Std-Discussion <std-discussion_at_[hidden]> wrote:
There is a new idea: execute code after compiling, before running, called pre-execution.
Then we have 3 stages to run code:
compile-time -> pre-execution -> runtime
Pre-execution can use the result of compile-time code, while compile-time code cannot use the former,
and runtime code is similar.
Follow this idea, it won't break the existing compile-time features, and we can slove the problem before, and it costs less time than the last.

Actually some projects and languages did it, such as Unreal Header Tool and build.rs of Rust.

Do you think it's feasible or not?
________________________________
发件人: Std-Discussion <std-discussion-bounces_at_[hidden]> 代表 Thiago Macieira via Std-Discussion <std-discussion_at_[hidden]>
发送时间: 2025年7月14日 1:08
收件人: std-discussion_at_[hidden] <std-discussion_at_[hidden]>
抄送: Thiago Macieira <thiago_at_[hidden]>
主题: Re: [std-discussion] 回复: 回复: Compile-time Variables and Stateful Meta-programming / STMP

On Sunday, 13 July 2025 11:26:56 Central Daylight Time SD SH via Std-
Discussion wrote:
> If this option breaks the features above, we should give this idea up.

Ok, then it's settled.

Received on 2025-07-15 05:28:27