-
-
Notifications
You must be signed in to change notification settings - Fork 422
Fix issue 8411 - add opCast!bool support for Duration. #1793
Conversation
|
src/core/time.d
Outdated
@@ -1104,6 +1104,21 @@ public: | |||
} | |||
} | |||
|
|||
/++ | |||
Returns `true` if this duration is non-zero. |
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.
Returns:
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.
Fixed
Not sure what the test error is, looks like a fluke segfault in unrelated std.parallelism, so I deprecated it. In any case, thank you all for the approvals. Can I get an automerge from one of you? 😉 |
The green check mark vs the grey one shows who has merge permissions. |
Ah, I forget you all don't have druntime cred. I will just push the button, don't think this is controversial. |
Auto-merge toggled on |
My fix for that is dlang/phobos#5004 and it's been gathering dust for ~4 months. |
Checking whether a duration is zero or not is a handy mechanism. Furthermore, it allows one to check if a duration is zero, and allows declaring a new duration variable at the same time: