Boost logo

Boost :

From: Gennadiy Rozental (gennadiy_at_[hidden])
Date: 2002-09-26 02:23:51


Let say I have one global array int stat[100][100]. And want to write an
initializer for it that follow formula like this:

if j2 > j >= j1 && i2 > i >= i1
x[i][j] = i - i1;
else
x[i][j] = 0

Or something similar.

Obviously I could type all the elements, but it's inconvenient, difficult to
change and error prone. Could MPL or BOOST_PP be of some help here?

Thanks,

Gennadiy.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk