On Thursday, 14 July 2016 at 19:28:23 UTC, Andrey wrote:
On Thursday, 14 July 2016 at 19:27:14 UTC, Andrey wrote:
[...]
struct Sigmoid(T)
{
[...]
}
struct Neurons_layer(T = float, size_t neurons_num = 0, F =
Sigmoid!T)
if(isFloatingPoint!T && is(typeof(F.Function)))
{
[...]
private:
alias Function = F.Function;
}
unittest
{
Neurons_layer!(float,5,Sigmoid!float) nf;
}
The question is - How to make in pretty way this line:
Neurons_layer!(float,5,Sigmoid!float) nf;
to something like - Neurons_layer!(float,5,Sigmoid) nf;
Make F an alias parameter:
----
struct Neurons_layer(T = float, size_t neurons_num = 0, alias F =
Sigmoid)
if(isFloatingPoint!T && is(typeof(F!T.Function)))
{
...
private:
alias Function = F!T.Function;
}
unittest
{
Neurons_layer!(float,5,Sigmoid) nf;
}
----