Here's my code
void execute() {
for (u32 f = 0; f < numForces; f++)
{
u32 length = end - start;
PhysicalObject* arr = objects + start;
std::vector<bool> tmp(length);
bool* tmpArr = tmp.data();
forces[f].affected(arr, length, tmpArr);
for(u32 index = 0; index < length; index++)
if (tmp[index])
forces[f].apply(arr[index]);
}
}
the line
bool* tmpArr = tmp.data();
throws me the error: "void value not ignored as it ought to be" I've looked into the documentation and I'm certain vector's data method is non void and should return a pointer: > http://www.cplusplus.com/reference/vector/vector/data/
Any ideas of what could be going wrong?
Important things:
- I'm including vector
- My compiling flags on gcc: -Wall -Wextra -Wcast-qual -pedantic -pedantic-errors -Wfatal-errors -Wno-missing-braces -Werror
- the function is a class but I haven't added the rest as it just removes focus from the problem and it's a class made to run in parallel which uses a complex architecture.