C++ Logo

std-discussion

Advanced search

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

From: SD SH <Z5515zwy_at_[hidden]>
Date: Sat, 12 Jul 2025 03:40:19 +0000
There are a template:
template<typename T>
struct depend_t
{
    using depend = type_list<>;
    using conflict = type_list<>;
};
It records a node in a dependence graph,
A example:
depend_t<A>: d = ...<B>, c = ...<>
...<B>: d = <>, c = <C>
...<C>: d = <>, c = <B>
...<D>: d = <>, c = <>
then we can generate a list:
D
[B, C]->A
so in this case, we can execute D::update and (B::update or C::update) at the same time, then ideally we can save about 25% time to execute ?::update (assume the time of all update function is same in this example)
All informations are known in compile-time, I think we need a way to generate it at that time.
________________________________
发件人: Std-Discussion <std-discussion-bounces_at_lists.isocpp.org> 代表 Thiago Macieira via Std-Discussion <std-discussion_at_[hidden]>
发送时间: 2025年7月12日 11:20
收件人: std-discussion_at_[hidden] <std-discussion_at_[hidden]>
抄送: Thiago Macieira <thiago_at_macieira.org>
主题: Re: [std-discussion] Compile-time Variables and Stateful Meta-programming / STMP

On Friday, 11 July 2025 19:28:44 Pacific Daylight Time SD SH via Std-Discussion
wrote:
> Actually the register is able to be run in compile-time, then I have a
> faster program in runtime.

It is? Can you explain how this will work, in detail?

--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Platform & System Engineering



--
Std-Discussion mailing list
Std-Discussion_at_[hidden]
https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion

Received on 2025-07-12 03:40:33