diff --git a/mex/sources/bytecode/ErrorHandling.hh b/mex/sources/bytecode/ErrorHandling.hh index a45211e07..dd462e003 100644 --- a/mex/sources/bytecode/ErrorHandling.hh +++ b/mex/sources/bytecode/ErrorHandling.hh @@ -406,14 +406,14 @@ public: for (unsigned int i = 0; i < endo_name_length; i++) if (P_endo_names[CHAR_LENGTH*(variable_num+i*nb_endo)] != ' ') res << P_endo_names[CHAR_LENGTH*(variable_num+i*nb_endo)]; - Variable_list.push_back(make_pair(res.str(), make_pair(SymbolType::endogenous, variable_num))); + Variable_list.emplace_back(res.str(), make_pair(SymbolType::endogenous, variable_num)); } for (unsigned int variable_num = 0; variable_num < static_cast(nb_exo); variable_num++) { for (unsigned int i = 0; i < exo_name_length; i++) if (P_exo_names[CHAR_LENGTH*(variable_num+i*nb_exo)] != ' ') res << P_exo_names[CHAR_LENGTH*(variable_num+i*nb_exo)]; - Variable_list.push_back(make_pair(res.str(), make_pair(SymbolType::exogenous, variable_num))); + Variable_list.emplace_back(res.str(), make_pair(SymbolType::exogenous, variable_num)); } } diff --git a/mex/sources/bytecode/SparseMatrix.cc b/mex/sources/bytecode/SparseMatrix.cc index b6aed5030..0c013cb9b 100644 --- a/mex/sources/bytecode/SparseMatrix.cc +++ b/mex/sources/bytecode/SparseMatrix.cc @@ -3172,7 +3172,7 @@ dynSparseMatrix::Solve_Matlab_Relaxation(mxArray *A_m, mxArray *b_m, unsigned in b1 = substract_A_B(b2, tmp); mxDestroyArray(tmp); - triangular_form.push_back(make_pair(S1, d1)); + triangular_form.emplace_back(S1, d1); mxDestroyArray(A2_t); } A2 = mxDuplicateArray(A3); diff --git a/mex/sources/bytecode/bytecode.cc b/mex/sources/bytecode/bytecode.cc index 14c1f15d2..1045c81f1 100644 --- a/mex/sources/bytecode/bytecode.cc +++ b/mex/sources/bytecode/bytecode.cc @@ -673,7 +673,7 @@ main(int nrhs, const char *prhs[]) string tmp = "Can not allocated memory to store the date_str in the extended path descriptor"; mexErrMsgTxt(tmp.c_str()); } - dates.push_back(string(buf)); //string(Dates[i]); + dates.emplace_back(buf); //string(Dates[i]); mxFree(buf); } } diff --git a/mex/sources/bytecode/testing/mex_interface.cc b/mex/sources/bytecode/testing/mex_interface.cc index da1136995..50235ecfd 100644 --- a/mex/sources/bytecode/testing/mex_interface.cc +++ b/mex/sources/bytecode/testing/mex_interface.cc @@ -250,7 +250,7 @@ mxAddField(mxArray *Struct, const char *fieldname) return -1; else { - Struct->field_name.push_back(fieldname); + Struct->field_name.emplace_back(fieldname); return Struct->field_name.size(); } } @@ -264,7 +264,7 @@ mxSetFieldByNumber(mxArray *Struct, mwIndex index, unsigned int field_number, mx if (field_number >= nfields) mexErrMsgTxt("field_number out of range in mxSetFieldByNumber\n"); while (Struct->field_array.size() <= index) - Struct->field_array.push_back(vector(nfields, NULL)); + Struct->field_array.emplace_back(nfields, NULL); Struct->field_array[index][field_number] = pvalue; } @@ -355,7 +355,7 @@ read_struct(FILE *fid) char name[512]; fscanf(fid, "%s", name); if (j == 0) - fieldnames.push_back(name); + fieldnames.emplace_back(name); v_Array.push_back(read_Array(fid)); } vv_Array.push_back(v_Array);