R
Rui Maciel
Does anyone know if it's possible to use (or abuse) variadic templates to
implement a way to concisely pull off function composition?
The following example can better describe what I mean:
<pseudo-code>
B AtoB(A)
{
//... do something
return B(something);
}
C BtoC(B)
{
//... do something
return C(something);
}
D CtoD(C)
{
//... do something
return D(something);
}
int main(void)
{
A a;
D d = composition<AtoB, BtoC, CtoD>(a); // magic happens
return 0;
}
</pseudo-code>
Thanks in advance,
Rui Maciel
implement a way to concisely pull off function composition?
The following example can better describe what I mean:
<pseudo-code>
B AtoB(A)
{
//... do something
return B(something);
}
C BtoC(B)
{
//... do something
return C(something);
}
D CtoD(C)
{
//... do something
return D(something);
}
int main(void)
{
A a;
D d = composition<AtoB, BtoC, CtoD>(a); // magic happens
return 0;
}
</pseudo-code>
Thanks in advance,
Rui Maciel