-
-
Notifications
You must be signed in to change notification settings - Fork 706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 7878 - A problem with purity and general templated algorithms #544
Conversation
|
Feel free to close Issue 5505 as well, since it references |
| // else | ||
| // { | ||
| // alias comp binaryFun; | ||
| // } | ||
| } | ||
|
|
||
| unittest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you change /* to /** on line 142 you would fix Issue 5358
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Added a commit.
Marked as a duplicate of bug 7878. |
| @@ -6782,7 +6782,8 @@ sort(alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable, | |||
| Range)(Range r) | |||
| { | |||
| alias binaryFun!(less) lessFun; | |||
| static if (is(typeof(lessFun(r.front, r.front)) == bool)) | |||
| alias typeof(lessFun(r.front, r.front)) LessRet; // instantiate lessFun | |||
| static if (is(LessRet == bool)) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, is the point of this to make it so that when lessFun(r.front, r.front) fails to compile, you get the instantiation error rather than the static if's condition silently evaluating to false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Today template instantiation error trace is enough useful, and shows the real problem why you fail to compile less predicate.
Issue 7878 - A problem with purity and general templated algorithms
|
Merged. |
http://d.puremagic.com/issues/show_bug.cgi?id=7878
Today template instantiation backtrace is implemented, so suppress errors is not useful.