std.templatecons ready for comments
Ilya Yaroshenko
ilyayaroshenko at gmail.com
Sun Nov 10 11:22:23 PST 2013
On Sunday, 10 November 2013 at 17:54:13 UTC, Jacob Carlborg wrote:
> On 2013-11-10 16:30, Ilya Yaroshenko wrote:
>> Hello, All!
>>
>> std.templatecons: Functional style template constructors.
>>
>> Documentation:
>> http://9il.github.io/phobosx/std.templatecons.html
>>
>> Source:
>> https://github.com/9il/phobosx/blob/master/std/templatecons.d
>
> Don't we already have some of this functionallity, like
> templateStaticMap and templateStaticIndexOf?
Yes, for example template Filter(alias pred, TList...) from
std.typetuple.
But
alias templateFilter = ShellOneArg!Filter;
is not the same as Filter.
It can be used in compose/pipe and others:
unittest
{
import std.complex, std.traits;
alias Pipe
= templatePipe!(templateFilter!isFloatingPoint, CommonType,
Complex);
static assert(is(Pipe!(bool[][], immutable float, const
double, string)
== Complex!double));
}
More information about the Digitalmars-d
mailing list