This repository was archived by the owner on Oct 12, 2022. It is now read-only.
Fix issue 8411 - add opCast!bool support for Duration.#1793
Merged
schveiguy merged 2 commits intodlang:masterfrom Mar 17, 2017
Merged
Fix issue 8411 - add opCast!bool support for Duration.#1793schveiguy merged 2 commits intodlang:masterfrom
schveiguy merged 2 commits intodlang:masterfrom
Conversation
Contributor
|
jmdavis
approved these changes
Mar 16, 2017
src/core/time.d
Outdated
| } | ||
|
|
||
| /++ | ||
| Returns `true` if this duration is non-zero. |
PetarKirov
approved these changes
Mar 17, 2017
JackStouffer
approved these changes
Mar 17, 2017
Member
Author
|
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? 😉 |
Contributor
|
The green check mark vs the grey one shows who has merge permissions. |
Member
Author
Ah, I forget you all don't have druntime cred. I will just push the button, don't think this is controversial. |
Member
Author
|
Auto-merge toggled on |
Contributor
My fix for that is dlang/phobos#5004 and it's been gathering dust for ~4 months. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: