Extend D's switch statement?

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 8 02:57:16 PDT 2015


On Wed, 08 Jul 2015 07:15:25 +0000, Yuxuan Shui wrote:

> I think it will be useful to extent switch statement to support any type
> that implements opEquals and opHash.
> 
> Is there any technical difficulties to implement this?

no, you can do that* with some template programming. so there is no 
reason to increase compiler complexity.

* with some limitations, but they aren't that big.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150708/830e99b6/attachment.sig>


More information about the Digitalmars-d mailing list