@@ -1280,7 +1280,7 @@ int colvar::init_dependencies() {
12801280 // Initialize feature_states for each instance
12811281 feature_states.reserve (f_cv_ntot);
12821282 for (i = feature_states.size (); i < f_cv_ntot; i++) {
1283- feature_states.push_back ( feature_state ( true , false ) );
1283+ feature_states.emplace_back ( true , false );
12841284 // Most features are available, so we set them so
12851285 // and list exceptions below
12861286 }
@@ -2043,8 +2043,8 @@ void colvar::communicate_forces()
20432043 func_grads.reserve (cvcs.size ());
20442044 for (i = 0 ; i < cvcs.size (); i++) {
20452045 if (!cvcs[i]->is_enabled ()) continue ;
2046- func_grads.push_back (cvm::matrix2d<cvm::real> (x.size (),
2047- cvcs[i]->value ().size ())) ;
2046+ func_grads.emplace_back (x.size (),
2047+ cvcs[i]->value ().size ());
20482048 }
20492049 int res = cvm::proxy->run_colvar_gradient_callback (scripted_function, sorted_cvc_values, func_grads);
20502050
@@ -2803,7 +2803,7 @@ int colvar::calc_acf()
28032803 case acf_vel:
28042804 // allocate space for the velocities history
28052805 for (i = 0 ; i < acf_stride; i++) {
2806- acf_v_history.push_back (std::list<colvarvalue>() );
2806+ acf_v_history.emplace_back ( );
28072807 }
28082808 acf_v_history_p = acf_v_history.begin ();
28092809 break ;
@@ -2812,7 +2812,7 @@ int colvar::calc_acf()
28122812 case acf_p2coor:
28132813 // allocate space for the coordinates history
28142814 for (i = 0 ; i < acf_stride; i++) {
2815- acf_x_history.push_back (std::list<colvarvalue>() );
2815+ acf_x_history.emplace_back ( );
28162816 }
28172817 acf_x_history_p = acf_x_history.begin ();
28182818 break ;
@@ -3003,7 +3003,7 @@ int colvar::calc_runave()
30033003
30043004 acf_nframes = 0 ;
30053005
3006- x_history.push_back (std::list<colvarvalue>() );
3006+ x_history.emplace_back ( );
30073007 x_history_p = x_history.begin ();
30083008
30093009 } else {
0 commit comments