Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

Fix issue 8411 - add opCast!bool support for Duration.#1793

Merged
schveiguy merged 2 commits intodlang:masterfrom
schveiguy:addbooldur
Mar 17, 2017
Merged

Fix issue 8411 - add opCast!bool support for Duration.#1793
schveiguy merged 2 commits intodlang:masterfrom
schveiguy:addbooldur

Conversation

@schveiguy
Copy link
Member

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:

if(d = calculateDuration())
{
   // do something with d
}

@dlang-bot
Copy link
Contributor

Fix Bugzilla Description
8411 core.time: No easy way to check if Duration is empty

@dlang-bot dlang-bot added the Bug Fix Include reference to corresponding bugzilla issue label Mar 16, 2017
src/core/time.d Outdated
}

/++
Returns `true` if this duration is non-zero.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returns:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@schveiguy
Copy link
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? 😉

@JackStouffer
Copy link
Contributor

The green check mark vs the grey one shows who has merge permissions.

@schveiguy
Copy link
Member Author

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.

@schveiguy
Copy link
Member Author

Auto-merge toggled on

@schveiguy schveiguy merged commit 827fb5d into dlang:master Mar 17, 2017
@schveiguy schveiguy deleted the addbooldur branch March 17, 2017 15:00
@WalterWaldron
Copy link
Contributor

WalterWaldron commented Mar 28, 2017

looks like a fluke segfault in unrelated std.parallelism,

My fix for that is dlang/phobos#5004 and it's been gathering dust for ~4 months.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Bug Fix Include reference to corresponding bugzilla issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants