Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Remove unused _Unqual from object module #685

Merged
merged 2 commits into from
Dec 10, 2013
Merged

Conversation

9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented Dec 10, 2013

And I discovered that Unqual template can be simplified to alias Unqual(T) = typeof(cast()T.init);.

@yebblies
Copy link
Member

Auto-merge toggled on

else alias T _Unqual;
}
}
private alias _Unqual(T) = typeof(cast()T.init);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been wondering about doing something like this before. Can we also use this change for Phobos?

AFAIK (didn't completely look into this yet), this will fail if T provides an "opCast":
http://d.puremagic.com/issues/show_bug.cgi?id=5747#c4

That said, if this is used only on "trivial internal types", this change should be fine (but documented as "incorrect"...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right... I posted a reverting pull #686.

yebblies added a commit that referenced this pull request Dec 10, 2013
Remove unused _Unqual from `object` module
@yebblies yebblies merged commit 8d49e9d into dlang:master Dec 10, 2013
@9rnsr 9rnsr deleted the fix_unqual branch December 11, 2013 00:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants