lundi 26 juillet 2021

Difference between determination & evaluation of a value of an expression

I am studying order of evaluation of expressions and I came across this paragraph,

A constant expression is an expression that consists of only constant values. It is an expression whose value is determined at the compile-time but evaluated at the run-time. It can be composed of integer, character, floating-point, and enumeration constants.

Resource of paragraph: https://www.javatpoint.com/cpp-expression

Can someone elaborate what does determining a value & evaluating a value means ? aren't these the same. . .

Also, I landed to this paragraph after reading the following definition,

**Evaluation of Expressions

Evaluation of each expression includes:

value computations: calculation of the value that is returned by the expression. This may involve determination of the identity of the object (glvalue evaluation, e.g. if the expression returns a reference to some object) or reading the value previously assigned to an object (prvalue evaluation, e.g. if the expression returns a number, or some other value)

Initiation of side effects: access (read or write) to an object designated by a volatile glvalue, modification (writing) to an object, calling a library I/O function, or calling a function that does any of those operations.**

Resource: https://en.cppreference.com/w/cpp/language/eval_order

Kindly, explain (1) what does calculation of value means. An expression could be a function returning some value so what has to be calculated about that returned value?

(2) What does identification of an object means?

Aucun commentaire:

Enregistrer un commentaire