Explicit Type Conversion and Multiple Simple Type Specifiers

后端 未结 4 1391
执笔经年
执笔经年 2020-12-03 12:38

To value initialize an object of type T, one would do something along the lines of one of the following:

T x = T();
T x((T()));
<
4条回答
  •  爱一瞬间的悲伤
    2020-12-03 13:04

    I posted this question to comp.lang.c++.moderated.

    Daniel Krügler of the C++ standards committee agreed with the interpretation that unsigned int is a combination of simple type specifiers, and is not itself a simple type specifier.

    Concerning the caption of table 7 referenced by Jerry Coffin, Krügler says:

    I agree that the header of Table 7 (which is Table 9 in the most recent draft N3000) is somewhat misleading, but the preceeding text in [dcl.type.simple]/2 looks very clear to me, when it says:

    Table 7 summarizes the valid combinations of simple-type-specifiers and the types they specify."

    (I apologize it took me so long to post this back here from the newsgroup; it completely slipped my mind)

提交回复
热议问题