Boost logo

Boost :

From: Doug Gregor (gregod_at_[hidden])
Date: 2001-03-26 00:24:49

On Sunday 25 March 2001 10:49, you wrote:
> Too bad we can't overload operator,() for integers. There is no way we can
> write A[1,2,3]. Though, we may be able to get something close to it...

A generic name like "at" or "index" would suffice, i.e.,
A[index(1), index(2), index(3)]

Yet another alternative would be to use this relational operator syntax along
with the previously-proposed idea of multiple function call operators, except
use the subscript operator, i.e.,

A[1][0 <= stride(2) < 10][5]

This won't require any extra syntax and will work for anything. It also
mimics the usual way in which multiple dimensions are indexed.


Boost list run by bdawes at, gregod at, cpdaniel at, john at