http://d.puremagic.com/issues/show_bug.cgi?id=8411
Summary: core.time: No easy way to check if Duration is empty Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: druntime AssignedTo: nob...@puremagic.com ReportedBy: thecybersha...@gmail.com --- Comment #0 from Vladimir Panteleev <thecybersha...@gmail.com> 2012-07-22 06:46:38 PDT --- The simplest way to check for an empty Duration seems to be: if (!duration.total!"hnsecs"()) { ... } I suggest either implementing an isEmpty property (given that there already is an isNegative property), or implement opCast!bool so that the following will work: if (!duration) { ... } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------