pointer to std.algorithm.iteration : splitter

FeepingCreature feepingcreature at gmail.com
Thu Aug 31 09:45:02 UTC 2023


On Thursday, 31 August 2023 at 05:16:02 UTC, Vino wrote:
> Hi All,
>
>   Request your help on the below error
>
> Program
> ```
> void main()
> {
> 	import std.stdio:writeln;
> 	import std.algorithm.iteration : splitter;
> 	
> 	auto splitter_ptr = &splitter!((a, b) => a.splitter(b).array);
>     string str = "TEST1;TEST2;TEST3";
>     auto words = splitter_ptr(str, ';');
>     foreach (word; words) { writeln(word); }
> }
> ```
> ```
> Error: template instance `splitter!((a, b) => 
> a.splitter(b).array)` does not match any template declaration
> ```
>
> From,
> Vino

Why are you trying to take pointers of lots of different things? 
You should pretty much never need pointers in normal D code.


More information about the Digitalmars-d-learn mailing list