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

NamedType increment and decrement bypass range checks #192

Open
tomjnixon opened this issue Jan 15, 2024 · 0 comments
Open

NamedType increment and decrement bypass range checks #192

tomjnixon opened this issue Jan 15, 2024 · 0 comments

Comments

@tomjnixon
Copy link
Member

tomjnixon commented Jan 15, 2024

this test passes, and probably shouldn't:

TEST_CASE("NamedType_increment_check") {
  using namespace adm;
  using NamedIntegerRange = detail::NamedType<int, struct NamedIntegerRangeTag,
                                              detail::RangeValidator<0, 10> >;
  NamedIntegerRange value(0);
  value--;
}
tomjnixon added a commit that referenced this issue Jan 16, 2024
the mess here is to make sure that the new value is valid without
changing the old value, to make sure that the value stays valid even when
an exception is thrown

fixes #192
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

No branches or pull requests

1 participant