On Thursday, 1 January 2026 at 19:39:15 UTC, monkyyy wrote:
On Thursday, 1 January 2026 at 19:30:11 UTC, zhade wrote:
auto list = someExpensiveOperation();
return list
.filter!filterFunc
.map!mapFunc;
}
oh your looking to mutate the data
Consider my mutmap here if expensive operation is element by
element:
https://forum.dlang.org/post/[email protected]
The actual operations performed by 'filter' and 'map' are not
important. The original question was about how to return an empty
MapResult.
I also thought I could change the 'auto' return type to something
like `InputRange!(Tuple!(string, "value", int, "numLetters"))`
but that didn't work because InputRange != MapResult despite
MapResult effectively being an InputRange.
For now I'll stick with the additional function which applies the
filter and map function.