常量是指什么,const么。
10本来就是个int类型的prvalue。非类/数组类型的prvalue的类型无所谓cv-qualified,这个和C兼容。如果是个class倒是可以有const类型的prvalue。关于数组类型倒是有个CWG defect:http://wg21.cmeerw.net/cwg/issue1059 。
WG21/N3936
3.10
4 Unless otherwise indicated (5.2.2), prvalues shall always have complete types or the void type; in addition to
these types, glvalues can also have incomplete types. [ Note: class and array prvalues can have cv-qualified
types; other prvalues always have cv-unqualified types. See Clause 5. —end note ]
Note 56) In C++ class prvalues can have cv-qualified types (because they are objects). This differs from ISO C, in which non-lvalues never have cv-qualified types.