On 2017-02-14 15:37, Andrei Alexandrescu wrote:

How are they so,

Example [1]. That signature spans 8 lines, it took me 10 seconds to find the actual function name. Example [2], 5 lines. Adding attributes on top of that would increase the length of the signature even more. Fortunately templates will infer most attributes.

and what steps can we take to improve them. Could you
please give a few examples on how to do things better? Thx! -- Andrei

Well, I would prefer to have template constraints as its own entity in the language not not just a bunch of boolean conditions. This has been talked about before several times. Something like:

constraint Foo
{
    void foo();
}

void bar(T : Foo)(T t);

[1] https://github.com/dlang/phobos/blob/master/std/algorithm/mutation.d#L1682-L1689

[2] https://github.com/dlang/phobos/blob/master/std/algorithm/mutation.d#L2729-L2733

--
/Jacob Carlborg

Reply via email to