C++ destruction of temporary object in an expression

前端 未结 4 1464
孤街浪徒
孤街浪徒 2020-12-06 03:44

Given the following code:

#include 

struct implicit_t
{
    implicit_t(int x) :
        x_m(x)
    {
        std::cout << \"ctor\" <         


        
4条回答
  •  萌比男神i
    2020-12-06 04:10

    Temporary objects are destroyed as the last step in evaluating the full-expression (1.9) that (lexically) contains the point where they were created. [12.2/3]

提交回复
热议问题