I tried to initialize the std::vector
std::vector<Particle> particles; with instances of the simple struct
struct Particle { int id; double x; double y; double theta; double weight; }; by using emplace with an initializer list:
num_particles = 1000; for (int i = 0; i < num_particles; i++) { particles.emplace_back({ i,0.0,0.0,0.0,1 }); } But I get the error
C2660 "std::vector>::emplace_back": Function doesn't accept one argument
How can I fix that?
emplace_back. Theemplacefunction requires a position parameter.emplace(const_iterator __position, _Args&&... __args);