[phobos] Proposal of StopWatch module

SHOO zan77137 at nifty.com
Fri Aug 20 13:36:19 PDT 2010


(2010/08/21 4:06), Andrei Alexandrescu wrote:
> On 08/20/2010 02:00 PM, SHOO wrote:
>> (2010/08/20 19:35), SHOO wrote:
>>> I rewrote:
>>> http://ideone.com/5IgYU
>>> How about it?
>>>
>>> P.S. I used an immutable struct for the first time...
>>
>> Oops, I forgot AUTOSTART.
>> http://ideone.com/GiVmf
>> AutoStart.yes seems to be slightly redundant.
>> How about making a special type AutoStart with typedef and a AUTOSTART
>> with constant value(enum)?
>> See also: Line415, Line469, Line474-487
>
> About the general usefulness of
>
> enum SomeOption { no, yes }
>
> I suggest we ask the newsgroup. Phobos uses it a fair amount and I
> haven't heard complaints. I think the basic idiom is a net improvement
> over bool, but I agree that AutoStart.yes is a bit redundant. But then
> the solution would be to define a constant like AutoStart and then a
> constant like NoAutoStart. We're back to square one.
>
> At any rate, please no all-caps constants :o).
>
>
> Andrei

All right. I guess that's a way as well... But, does not UpperCamel look 
like a user-defined type name?


More information about the phobos mailing list