Boost logo

Boost :

From: Garrett Jones (alkaline_at_[hidden])
Date: 2002-09-05 20:38:09


I've been watching the list for a couple days, and i was wondering if there
was interest in a 2-dimensional container template class, which would be
called "grid". It is possible to make a 2-dimensional grid with vectors, but
all of the internal vectors have to be resized independently and they would
all be in different locations of memory. The grid template would have a
single area in memory for the contents, and data could be accessed as if it
were a 2-dimensional array:

grid<int> vGrid;
vGrid.resize(3,3);
vGrid[2][2] = 0;

This is done by using a surrogate class, gridrow. Passing it to functions is
also easy:

void dosomething(grid<int> &rGrid);

dosomething(vGrid);

I already have the basics working and have used it successfully in a couple
(one-user) programs. So, if there is interest, what do i do to prepare it
for submission? Also, are there already template classes available somewhere
with this type of functionality?

--
Garrett Jones
http://www.alkaline.org

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