Skip to content
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

numeric_cast will never throw #200

Open
obatysh opened this issue Mar 3, 2022 · 1 comment
Open

numeric_cast will never throw #200

obatysh opened this issue Mar 3, 2022 · 1 comment
Assignees
Labels
Milestone

Comments

@obatysh
Copy link

obatysh commented Mar 3, 2022

Check in numeric_cast will never throw, as after the cast to the TargetType the value will never be greater than the maximum of the TargetType:
if (static_cast(value) >
std::numeric_limits::max())
{
throw std::overflow_error("Cannot convert ");
}

@idolum idolum added the bug label Mar 4, 2022
@idolum idolum self-assigned this Mar 4, 2022
@idolum idolum added this to the 0.11 milestone Mar 4, 2022
@idolum
Copy link
Member

idolum commented Mar 4, 2022

@obatysh You are right! We will fix this. Thanks!

@idolum idolum unassigned rbns Apr 4, 2022
@idolum idolum modified the milestones: 0.11, 0.12 Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants