syntax sugar: std.path::buildPath instead of from!"std.path".buildPath
Andrei Alexandrescu via Digitalmars-d
digitalmars-d at puremagic.com
Wed Feb 15 11:39:52 PST 2017
On 02/15/2017 06:20 AM, Daniel N wrote:
> On Wednesday, 15 February 2017 at 09:22:14 UTC, Daniel N wrote:
>> template every(T...)
>> {
>> template satisfies(U...)
>> {
>> enum satisfies = true;
>> }
>> }
>
> (lunch-break => time to hack D!)
>
> template every(T...)
> {
> template satisfies(U...)
> {
> enum satisfies = {
> foreach(t; T)
> foreach(u; U)
> if(!u!t)
> return false;
> return true;
> }();
> }
> }
That looks pretty neat. Can you find 4-5 cases in which this could be
used gainfully in Phobos? Thanks! -- Andrei
More information about the Digitalmars-d
mailing list