开发者

Can an array or function lvalue be converted to an rvalue?

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 i开发者_运维问答t mean that array and function cannot be converted to rvalue?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜