Skip to content

Conversation

bavulapati
Copy link
Contributor

@jviotti We are currently using assert before consuming std::optional's value.
The assert won't be present in production builds.
How should we handle this case? What to do in the case where optional doesn't have value?

@jviotti
Copy link
Member

jviotti commented Jul 22, 2025

Unless there is a case I missed and escaped the tests (could be?), I only assert when I'm sure that the optional is set because of some other pre-conditions, etc

Signed-off-by: Balakrishna Avulapati <[email protected]>
Signed-off-by: Balakrishna Avulapati <[email protected]>
Signed-off-by: Balakrishna Avulapati <[email protected]>
Signed-off-by: Balakrishna Avulapati <[email protected]>
Signed-off-by: Balakrishna Avulapati <[email protected]>
@bavulapati
Copy link
Contributor Author

@jviotti PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants