Reputation: 3
I keep getting the same error with my code and still after searching through similar questions, I can't figure out what to do. Error occurs on the line stating "building[0].push_back(Person()".
std::vector<std::vector<Person()>> addPeople(std::vector<std::vector<Person()>> building)
{
std::poisson_distribution<int> distribution(0);
for (int i = 0; i < 100; i++)
{
int test = distribution(generator);
if (test >= 0 && test <= 6)
{
if (test = 0)
{
building[0].push_back(Person());
}
else if (test = 6)
{
building[0].push_back(Person());
}
}
}
return building;
}
Upvotes: 0
Views: 202
Reputation: 218323
std::vector<std::vector<Person()>> building
should probably be std::vector<std::vector<Person>> building
.
Person()
in that context is a function taking nothing, and returning Person
.
Upvotes: 1