Quote Originally Posted by sdcode View Post
Not sure I can live with the crud :/
If data1, data2, etc. happen to be the same size, you can use a 2D array instead. Beyond that, I don't think there's much you can do, except use Speedo's solution, which is admittedly much cleaner.

One question, where can i find documentation that shows the map constructor for the following code?
Code:
 const map<int, map<int, int> > some_class::table(data, data + N);
Take a look at http://www.sgi.com/tech/stl/Map.html

The constructor in question is this one:

Code:
template <class InputIterator>
map(InputIterator f, InputIterator l)
InputIterator can be any iterator (including a pointer into an array) whose value type is the map's value_type (the value type of map<T, U> is pair<T, U>).