February 22, 2022 Learn » Re: how to return map(fn) | |||
|---|---|---|---|
| |||
...an alias as in your original post can be used as well: template mappified(alias... | |||
February 22, 2022 Learn » Re: Odd behaviour of std.range | |||
|---|---|---|---|
| |||
...char) as elements. It is just an alias: alias string = immutable(char)[]; > where it's... | |||
February 22, 2022 Learn » Re: Odd behaviour of std.range | |||
|---|---|---|---|
| |||
...is* an array. `string` is just an alias for `immutable(char)[]`. T -- Gone Chopin. Bach... | |||
February 22, 2022 Learn » Re: how to return map(fn) | |||
|---|---|---|---|
| |||
...array` as follows:
```d
float[] get_map(alias f)(float[] input){
import std.algorithm : map... | |||
February 22, 2022 General » Re: Discussion Thread: DIP 1035--@system Variables--Final Review | |||
|---|---|---|---|
| |||
...The example shows a way to (unintentionally) alias an existing fd (obtained through whichever means... | |||
February 21, 2022 Learn » Re: how to return map(fn) | |||
|---|---|---|---|
| |||
...take care of the rest:
auto mapped(alias f, Range) (Range range) {
import std.algorithm... | |||
February 21, 2022 Learn » Re: SumType alias can't be deduced? | |||
|---|---|---|---|
| |||
Oh, that’s an unfortunate limitation but at least there’s a workaround. Thank you! | |||
February 21, 2022 Learn » how to return map(fn) | |||
|---|---|---|---|
| |||
...the alias in the example. i.e. something like: ``` float[] function(float[]) get_map(alias... | |||
February 21, 2022 Learn » Re: SumType alias can't be deduced? | |||
|---|---|---|---|
| |||
...template argument deduction: it cannot "see through" `alias` templates to deduce the underlying type. The... | |||
February 21, 2022 Learn » SumType alias can't be deduced? | |||
|---|---|---|---|
| |||
...hNaSFh:
```d
import std.sumtype;
struct Unit {}
alias Option(T) = SumType!(T, Unit);
void foobar... | |||
Copyright © 1999-2021 by the D Language Foundation