D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6824 - core.time.TickDuration.to template problem
Summary: core.time.TickDuration.to template problem
Status: RESOLVED DUPLICATE of issue 6502
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2011-10-18 03:57 UTC by bearophile_hugs
Modified: 2011-10-18 08:14 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2011-10-18 03:57:38 UTC
This code:

import std.datetime: StopWatch;
void main() {
    StopWatch sw;
    auto n = sw.peek().nsecs;
}


Compiled with:
dmd -O -release -inline -noboundscheck test.d

using DMD 2.056head gives:

...\dmd2\windows\bin\..\..\src\druntime\import\core\time.di(262): Error: template core.time.TickDuration.to(string units,T) if ((units == "seconds" || units == "msecs" || units == "usecs" || units == "hnsecs" || units == "nsecs") && (__traits(isIntegral,T) && T.sizeof >= 4)) does not match any function template declaration
...\dmd2\windows\bin\..\..\src\druntime\import\core\time.di(262): Error: template core.time.TickDuration.to(string units,T) if ((units == "seconds" || units == "msecs" || units == "usecs" || units == "hnsecs" || units == "nsecs") && (__traits(isIntegral,T) && T.sizeof >= 4)) cannot deduce template function from argument types !("seconds",long)()
Comment 1 Jonathan M Davis 2011-10-18 08:14:08 UTC

*** This issue has been marked as a duplicate of issue 6502 ***