convertTo

template convertTo(alias InterfaceTemp)
package
InterfaceTemp!F
convertTo
(
Fun
F = ReturnType!Fun
)
(
Fun fun
)

Examples

1 import std.math;
2 import atmosphere.pdf;
3 
4 real fun(real x)
5 {
6 	// 1/sqrt(2 PI)
7 	enum c = 0.398942280401432677939946L;
8 	return c * exp(-0.5f * x * x);
9 }
10 
11 PDF!real pdf = convertTo!PDF(&fun);

Meta