When an array is created by a subexpression, what happens with the temporaries therein?

前端 未结 1 1018
無奈伤痛
無奈伤痛 2021-02-19 00:02

I was reading these two paragraphs of the FDIS (12.2p{4,5}):

There are two contexts in which temporaries are destroyed at a different point than the end o

相关标签:
1条回答
  • 2021-02-19 00:12

    I don't think there's a contradiction.

    5.2.2 clearly says what a function call is. A function call is a postfix expression followed by parentheses containing a possibly empty, comma-separated list of expressions which constitute the arguments to the function.

    There doesn't seem to be a function call to B::B(A const&) anywhere in your program, so I don't see how the second passage applies.

    EDIT the above is probably incorrect, given 1.9p10 etc.

    0 讨论(0)
提交回复
热议问题