write once type?

sighoya sighoya at gmail.com
Fri Apr 30 16:42:28 UTC 2021


On Friday, 30 April 2021 at 13:36:10 UTC, Steven Schveighoffer 
wrote:
> I could have looped 2x over the args, and used an inner 
> function to fetch the first one (or maybe used a staticIndexOf 
> to get the first ColumnDef thing), and a second loop to verify 
> all the remaining args have the same table def, but this loop 
> works just as designed and is super-readable.

I would say likewise using static indexing, is it really that 
slow?

Otherwise, iterate over Pair-like partitions would also be a 
solution and compare if first.tableDef is second.tableDef, don't 
know if D has something for this statically available.

Further, I would like to refactor the static if out to an 
in-requirement, though I'm unsure if in-assertions support 
arbitrary exception types.



More information about the Digitalmars-d-learn mailing list