-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std::optional
instead of -1
indices
#268
Labels
misimplementation
Circumlocutious or redundant implementation
Comments
no-lex
added a commit
that referenced
this issue
Oct 21, 2023
Do you mind if I start tackling this? |
of course not |
This was referenced Nov 11, 2023
Closed
no-lex
added a commit
that referenced
this issue
Dec 4, 2023
no-lex
added a commit
that referenced
this issue
Jan 21, 2024
no-lex
added a commit
that referenced
this issue
Aug 1, 2024
no-lex
added a commit
that referenced
this issue
Aug 15, 2024
no-lex
added a commit
that referenced
this issue
Aug 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: