Value returning function question

How is the definition of the term "expression" affected by value returning functions, and why?
This sounds like something taken out of context. What definition are you talking about? If this is your homework your teacher might have given you a definition?
An expression is a sequence of operators and their operands
An expression has a type and a value category.
The value category is different for functions returning references and functions returning values.

With int& foo() ; the expression foo() has type int and value category lvalue

With int bar() ; the expression bar() has type int and value category prvalue (pure rvalue)

See: http://en.cppreference.com/w/cpp/language/value_category
Last edited on
Joeystacks wrote:
An expression is a sequence of operators and their operands

Then the question is probably how this definition has to be changed to also include the use of function calls.
Function call is an operator (it's even overloadable as "operator()")
Topic archived. No new replies allowed.