On 10-Oct-2006, Michael Goffioul wrote:
| #define NDS_CMP_OP2(F, OP, ND, NDC, S, SC, SPEC1, SPEC2) \
| boolNDArray \
| F (const ND& m, const S& s) \
| { \
| boolNDArray r; \
| \
| int len = m.length (); \
| \
| r.resize (m.dims ()); \
| \
| for (int i = 0; i < len; i++) \
| r.elem(i) = operator OP <SPEC1,SPEC2> (NDC (m.elem(i)), SC (s)); \
| \
| return r; \
| }
Another thought. If SPEC1 and SPEC2 are the types of the operands to
OP, then does it work to write
operator OP <typeof(m.elem(i)), typeof(s)> (NDC (m.elem(i)), SC (s));
instead? If so, then I think we can avoid changing the interface of
the macro.