September 18
>

phobos v3 will have less templates, especially conv.to -dconf

struct myint{
  int i;
  bool isvalid;
  int to!int()=>cast(int)i;
}
import std.conv;
myint[][][string] foo;
foo.to!(int[][][string]);

A recursive hyper overloaded .to template is the best way to support this operation of nested user types; theres things to be said about simplifying the std, but its not via removing templates as a preemptive style decision.

T[] to(T[],S)(S[] array...){
  T[] output;
  foreach(e;array){
    output~=e;
  }
  return output;
}

The average block of std code is about 1000x more complex then what I would write but templates are essental complexity here

September 18

On Wednesday, 18 September 2024 at 04:55:53 UTC, monkyyy wrote:

>

The average block of std code is about 1000x more complex then what I would write but templates are essental complexity here

I also create my own types in embedded implement the array(), take() and to() methods as you mentioned.

I actually like the HOFs, but you need to stay away from situations that require speed.

SDB@79