Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between "execution" and "evaluation" #5305

Open
xmh0511 opened this issue Feb 20, 2022 · 0 comments
Open

Difference between "execution" and "evaluation" #5305

xmh0511 opened this issue Feb 20, 2022 · 0 comments

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Feb 20, 2022

[intro.execution] p8 strictly states that

Sequenced before is an asymmetric, transitive, pair-wise relation between evaluations executed by a single thread ([intro.multithread]), which induces a partial order among those evaluations.

In other words, the "sequenced before" is based on two "evaluations". We can note that we use "execute" in the whole of clause [stmt.stmt], such as:

Except as indicated, statements are executed in sequence.

If the condition ([stmt.select]) yields true the first substatement is executed.

and so on.

An unclear point by using "sequenced before" is in [basic.start.dynamic] p5

It is implementation-defined whether the dynamic initialization of a non-block non-inline variable with static storage duration is sequenced before the first statement of main or is deferred.

statements are said to be executed while expressions are said to be evaluated. The wording in [intro.execution] p8 is more and less implies that the "sequenced before" is applied to two expressions, or at least to the language construct that is evaluated. So, the issue arises from the meaning between "execution" and "evaluation".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant