(2010/08/28 2:31), Yao G. wrote:
On Fri, 27 Aug 2010 12:18:19 -0500, SHOO <[email protected]> wrote:
You can use:
auto sw = new StopWatch(autoStart);
AutoStart.yes is redundant expression.
And, it is impossible to make default behavior of the StopWatch
AutoStart.yes.
This comes from that StopWatch is a struct.
struct cannot run default behavior.
_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos
How about a stopWatch function that returns a StopWatch struct,
something like the std.range module does:
StopWatch stopWatch( AutoStart as = AutoStart.Yes )
{
return StopWatch( as );
}
auto watch = stopWatch();
Or it would be too confusing?
stopWatch looks like a function to stop a watch...
And also, I think default behavior of the StopWatch is AutoStart.no.
The reason is because it's important that regulate time to start for
time measurement.
_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos