Extend vector ops to boolean operators?

Kapps opantm2+spam at gmail.com
Tue Mar 6 13:58:12 PST 2012


On Tuesday, 6 March 2012 at 20:28:40 UTC, H. S. Teoh wrote:
> It'd be really cool if I could do this:
>
> 	void func(int[] vector, int[] bounds) {
> 		assert(vector[] >= 0 && vector[] < bounds[]);
> 		...
> 	}
>
> Is there any reason why we shouldn't implement this?
>
>
> T

Would this be possible with UFCS?

int opCmp(T)T([] array, T element) { ... }
int opCmp(T)(T[] array1, T[] array2) { ... }


More information about the Digitalmars-d mailing list