Comparison of TickDuration and StopWatch.peek

Matej Nanut matejnanut at gmail.com
Tue Feb 28 11:14:14 PST 2012


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 comments say it is one). I find .front and
.peek have more or less the same meaning, obviously for different data
structures. The time complexities are probably different as well. But
I find the meaning to be synonymous. Although this might be a re-run
of the .by(Value|Key) debate a while ago.

I will create a report later this evening: should it be about D not
having the same lvalue semantics as C++ or the actual implementation
of opCmp for TickDuration?

Thanks, Matej

On 28 February 2012 20:04, Andrej Mitrovic <andrej.mitrovich at gmail.com> wrote:
> 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.


More information about the Digitalmars-d-learn mailing list