[phobos] phobos commit, revision 1919
Yao G.
yao.gomez at gmail.com
Fri Aug 27 10:31:59 PDT 2010
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?
--
Yao G.
More information about the phobos
mailing list