Comparison of TickDuration and StopWatch.peek

2012-02-28 Thread Matej Nanut
Hello everyone, I have the following code snippet: import core.time:TickDuration; import std.datetime: StopWatch, AutoStart; void main() { auto wait = TickDuration.from!`msecs`(1000); auto timer = StopWatch(AutoStart.yes); while (timer.peek wait) // Okay. { } while

Re: Comparison of TickDuration and StopWatch.peek

2012-02-28 Thread Jonathan M Davis
On Tuesday, February 28, 2012 19:15:01 Matej Nanut wrote: Hello everyone, I have the following code snippet: import core.time: TickDuration; import std.datetime: StopWatch, AutoStart; void main() { auto wait = TickDuration.from!`msecs`(1000); auto timer =

Re: Comparison of TickDuration and StopWatch.peek

2012-02-28 Thread Andrej Mitrovic
Also you can force property calls in your code if you compile with -property. Property notation has not been enforced so far, but might be in the future afaik.

Re: Comparison of TickDuration and StopWatch.peek

2012-02-28 Thread Matej Nanut
So I can call any (void) method without parenthesis without -property? I guess I'll just add -property to all my programs from now on. But why isn't .peek() a property? In std.container, for example, the BinaryHeap has a .front property (even though it isn't declared as such on dlang.org, but the

Re: Comparison of TickDuration and StopWatch.peek

2012-02-28 Thread Jonathan M Davis
On Tuesday, February 28, 2012 20:14:14 Matej Nanut wrote: So I can call any (void) method without parenthesis without -property? I guess I'll just add -property to all my programs from now on. But why isn't .peek() a property? In std.container, for example, the BinaryHeap has a .front property