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?