Question

According to C++ Standard 2003:

An lvalue (3.10) of a non-function, non-array type T can be converted to an rvalue.

What does it mean that array and function cannot be converted to rvalue?

Was it helpful?

Solution

Both function and array types are covered by later clauses (4.2, 4.3).

An lvalue or rvalue of type “array of N T” or “array of unknown bound of T” can be converted to an rvalue of type “pointer to T.” The result is a pointer to the first element of the array.

(...)

An lvalue of function type T can be converted to an rvalue of type “pointer to T.” The result is a pointer to the function.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top