Bug 6824 – core.time.TickDuration.to template problem

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-10-18T03:57:00Z
Last change time
2011-10-18T08:14:08Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-10-18T03:57:38Z
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 by issues.dlang — 2011-10-18T08:14:08Z
*** This issue has been marked as a duplicate of issue 6502 ***