[Issue 11571] introduce "originalType" in std.conv

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 31 13:49:44 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11571



--- Comment #4 from monarchdodra at gmail.com 2014-03-31 13:49:41 PDT ---
(In reply to comment #3)
> (In reply to comment #2)
> > > I'd like to request the function "originalType", which would be std.traits'
> > "OriginalType", but that operates on values.
> 
> Missed that part. Although it's kind of very trivial for inclusion..

Yes, but it *does* trigger inference. EG:
a.originalType;
vs
cast(OriginalType!(typeof(a))a;

It's really no different from:
- appender
- representation
- tuple
- [un]signed
- zip
- ...

All of these functions are trivial. But convenient.

It also helps avoiding things like "if (is(T E == enum)) ..." altogether, if
you can just paste ".originType" after it, and be done with it...

...Unless you have an enum type that's whose values are a subset of another
enum (recursion)? I don't think a lot of code in phobos supports that :D

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list