The stated purpose of the recordFood function (obtained from the comment in code) is to "record amount of food currently being contained by all the condo's and record it for later." How does the argument received by the function further that cause?
1 2 3 4
double checkFoodSupply::recordFood(T nT) {
for (auto & condo : CondoSupply) // for each condo in CondoSupply
records.push_back({ 1, condo.foodSupply() }); // 1 is a placeholder for a more useful value.
}
Note that nT is not used, because I have no idea what it is supposed to represent. Feeding the function a time to be used rather than the placeholder might make sense.
[edit: I changed line 81 to be: std::vector<foodAmount> records; since what you had was a syntax error.]
Does it matter if my function is a double but returns nothing?
Yes. If you promise to return a value, you're required to return a value.
Why is line 81 a syntax error? Doesn't the private function have to differ from the public, and doesn't the const have to stay for both?
Hmm. Well, I have to admit I didn't attempt to compile it as-is, because it didn't make sense for that to be a function. Especially, given the attempted implementation of your recordFood method.
Should I also have removed the & symbol before my CondoSupply in the private?
I'm not sure what you're referring to here.
For the next part, if I want to return the record of food to someone, can I directly return the vector or do I need to return every element of it, like you do with arrays?