C++11 emplace_back on vector?

前端 未结 8 655
借酒劲吻你
借酒劲吻你 2020-12-02 14:58

Consider the following program:

#include 
#include 

using namespace std;

struct T
{
    int a;
    double b;
    string c;
};

         


        
8条回答
  •  悲&欢浪女
    2020-12-02 15:31

    For anyone from the future, this behavior will be changed in C++20.

    In other words, even though implementation internally will still call T(arg0, arg1, ...) it will be considered as regular T{arg0, arg1, ...} that you would expect.

提交回复
热议问题