request switch statement with common block

Walter Bright newshound2 at digitalmars.com
Sun Aug 4 11:53:28 PDT 2013


On 8/4/2013 11:30 AM, bearophile wrote:
> monarch_dodra:
>
>> Awesome. I'll have to introduce std.traits to this new syntax.
>
> That DIP is not updated to what was actually implemented by Kenji. There is
> support for both enum and alias.
>
> But after a good look at my code base I have not found many places where the new
> syntax is useful. In my opinion it's handy, but it's not a large win. And I
> still haven't seen any kind of such statistics done on Phobos before the
> implementation of this feature pair.
>
> People have asked for a more general syntax, useful in more templates, but I
> have not seen a serious answer that explains why DIP42 is a good idea, while the
> other more general proposal (of a Self or something to be used in templates to
> make them more DRY) is is worse.

I haven't collected statistics, but I see a repeated pattern in Phobos that is 
addressed by DIP42. It is also consistent with the other eponymous template 
shortcuts that enjoy wide usage.



More information about the Digitalmars-d mailing list