Mir simple linear

jmh530 john.michael.hall at gmail.com
Mon Mar 30 20:50:21 UTC 2020


On Monday, 30 March 2020 at 17:47:19 UTC, jmh530 wrote:
> 
> [snip]

The relevant function signature is

@safe sumType!YRange[2] simpleLinearRegression(XRange, 
YRange)(XRange x, YRange y)
if (isInputRange!XRange && isInputRange!YRange && 
!(isArray!XRange && isArray!YRange) && 
isFloatingPoint!(sumType!YRange));

and when you pass an int[] for y, then it determines that int is 
not a floating point and you get an error about not matching the 
signature, nothing about why you're not matching it.

A good example of where Atila's concepts library would be 
helpful...


More information about the Digitalmars-d-announce mailing list