-
-
Notifications
You must be signed in to change notification settings - Fork 706
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
Add @safe and pure to enforce family #263
Conversation
| { | ||
| if (!value) bailOut(file, line, msg); | ||
| if (!value) | ||
| bailOut(file, line, msg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great if there wouldn't be so many of these kind of changes, especially since we don't have a style policy on how to format short bodies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I have reverted that indentaitons. It is not my wish to be rejected this change because of the trivial.
But, I dislike not indented code even if they are short bodies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't be in a position to reject your changes anyway, and it's not like I would have a problem with splitting it to two lines, but imho arbitrary style changes for things not covered by the style guide should always be kept at a minimum, since it clutters up diffs and makes code needlessly hard to review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say that rewrites are fine when code is actually being revised, but minor changes to code that isn't being changed for other reasons shouldn't be happening.
|
Well, it does appear to work with arguments to enforce which aren't So, as long as we're sure that the behavior of |
|
Now issue 6690 was fixed, then we don't need the Which is better, adding |
|
I would argue that we should use |
| @@ -350,7 +350,7 @@ enforce(line.length, "Expected a non-empty line.")); | |||
| -------------------- | |||
| +/ | |||
| T enforce(T, string file = __FILE__, int line = __LINE__) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix all of the versions of enforce and its related functions so that line is size_t. I realize that it's not your fault in all cases (like this line), since it was int before in some cases, but it's a bit of a hodgepodge at the moment - including in your changes. It should be size_t in all cases, since __LINE__ is size_t. So, please make the change. Once that's done, I think that we should merge these changes in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I changed them into size_t.
Add @safe and pure to enforce family
|
Merged. |
By fixing issue 5750, we can add more
pureand@safetoenforcefamily.