[phobos] phobos commit, revision 1919
SHOO
zan77137 at nifty.com
Fri Aug 27 10:55:45 PDT 2010
(2010/08/28 2:31), Yao G. wrote:
> On Fri, 27 Aug 2010 12:18:19 -0500, SHOO <zan77137 at nifty.com> 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
>> phobos at puremagic.com
>> 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.
More information about the phobos
mailing list