Proposal to add 'Elements of Programming' Concepts to std.traits
Guillaume Chatelet
chatelet.guillaume at gmail.com
Fri Jun 22 14:37:16 PDT 2012
On 06/18/12 04:18, Andrei Alexandrescu wrote:
> I think traits are something that we could add piecemeal, without a
> large proposal - just as pull requests. For each particular concept
> there should be 1-2 compelling examples in the documentation, enough to
> make a case that the notion being added is worthwhile.
>
> For a simple example I'd like "arity" (I'm unclear whether it belongs in
> std.traits or std.functional). Sure, I could write
> ParameterTypeTuple!fun.length, but that's quite a roundabout way to go
> about it.
>
>
> Andrei
So here it is. A first very small patch to add arity to std.traits.
As you stated it could really go either in std.traits or std.functional.
I chose to keep it in std.traits because std.functional is more about
creating new functions of modifying existing ones whereas std.traits is
about deducing properties.
Guillaume
More information about the Digitalmars-d
mailing list