A converting problem in using "among" with arrays

pascal111 judas.the.messiah.111 at gmail.com
Fri Jul 29 22:09:47 UTC 2022


I next code, we have a data type problem 
"54.among(to!uint[10](y)).writeln;":

module main;

import std.stdio;
import std.string;
import std.conv;
import dcollect;
import std.math;
import std.algorithm;

     int main(string[] args)
     {
         int[] x=[23, 34,-88, 54, -90, -34];

         auto y=x.filter!(a=>a<0);

         foreach(i; y)
             i.write(", ");

         54.among(to!uint[10](y)).writeln;

     	return 0;
     }

Error message:
"hello.d|19|error: only one index allowed to index void|"


More information about the Digitalmars-d-learn mailing list