On 17 March 2011 20:00, Rodrigo Rivas wrote: >> Yes, I was just trying exactly that improvement. > How about this?
Nice. The comments should be changed too: If RANGE_EXPR is an array: BEGIN_EXPR = __range END_EXPR = __range + ARRAY_SIZE(__range) Else if __range.begin() or __range.end() is value BEGIN_EXPR = __range.begin() END_EXPR = __range.end(); Else: BEGIN_EXPR = begin(__range) END_EXPR = end(__range); ... /* If it is not an array, we must call __range.begin()/__range.end() if either exists, or begin(__range)/end(__range) otherwise. */