Dec 17, 2014 at 1:07am UTC
How is the definition of the term "expression" affected by value returning functions, and why?
Dec 17, 2014 at 1:25am UTC
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?
Dec 17, 2014 at 1:30am UTC
An expression is a sequence of operators and their operands
Dec 17, 2014 at 2:08am UTC
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 Dec 17, 2014 at 2:10am UTC
Dec 17, 2014 at 11:43am UTC
Function call is an operator (it's even overloadable as "operator()")