std::optional
instead of -1
indices
#268
Labels
misimplementation
Circumlocutious or redundant implementation
std::optional
instead of -1
indices
#268
Using
-1
for an invalid index is not very safe and also not necessary due to the existence ofstd::optional
. Withstd::optional
it should be possible to at least usesize_t
indices, the appropriate type for the indices of e.g. avector
, if notstd::optional<std::vector<>::iterator>
. Many parts of the codebase involve a data structure containing integral indices referring to another data structure, and while this is not good design, moving to std::optional would be a step in the right direction.The text was updated successfully, but these errors were encountered: