On Thursday, 13 January 2022 at 19:52:27 UTC, forkit wrote:
Any idea on how I can get a ptr (without hardcoding C style)
e.g. something like this:
immutable(string)*[] pointers = strings.filter!(x => x ==
"one").to!pointers.array;
```d
import std.stdio : writeln;
import std.algorithm : filter, map, each;
import std.range : array;
void main() @safe
{
immutable strings = ["one", "one", "two", "one", "two",
"one", "one", "two"];
immutable(string)*[] pointers = strings.filter!(x => x ==
"one").map!((ref x) @trusted => &x).array;
pointers.each!(p => writeln(p - &strings[0]));
}
```