I am new to C++ and I am trying to install the pybeesgrid package (https://github.com/berleon/pybeesgrid). In this specifc part of the pybeesgrid.cpp file:
void buildGridsFromNpArrWorkFn(
PyArrayObject * bits_and_config_ptr,
PyObject * maybe_grid_structure,
const size_t offset,
const size_t nb_todo,
std::vector<GeneratedGrid> &grids)
{
PyArrayObject * structure_arr = nullptr;
if (maybe_grid_structure != Py_None) {
structure_arr = reinterpret_cast<PyArrayObject*>(maybe_grid_structure);
}
for(size_t i = offset; i < offset + nb_todo; i++) {
Grid::idarray_t id;
size_t pos = 0;
for(size_t c = 0; c < NUM_MIDDLE_CELLS; c++) {
float cell = get_float(bits_and_config_ptr, i, pos);
++pos;
if(cell == 1.) {
id[c] = true;
} else if(cell == 0) {
id[c] = false;
} else {
id[c] = boost::tribool::indeterminate_value;
}
}
I am getting the error:
error: enum constant in boolean context [-Werror=int-in-bool-context]
236 | id[c] = boost::tribool::indeterminate_value;
Does anyone knows how to fix it?
I tried to supress the warning but then my file doesn't compile. I also tried to change the line to
id[c] = static_cast<uint64_t>(boost::tribool::indeterminate_value);
But it didn't work.