Howdy
I'm very new to Boost libraries, and this is my first try in using it, so pardon my naive questions. Now for the question:
I'm trying to port a Java module to C++, as in a J2ME game to Windows Mobile. I've re-written all the classes that the game code depends on the J2ME packages using Windows Mobile's native methods. Now for the last difference between the two: memory. The game code has lots of new and obviously no deletes, since Java has automatic garbage collection. So for the C++ equivalent , I thought of going for smart pointers, so that I needn't bother about memory leaks and to call delete for all news.
I've no problem in using smart pointers for normal dumb pointers. While it is the double
pointers that I'm confused of. Say if I have:
int **palette = new int* [5];
palette[0] = new int[10];
palette[1] = new int[7];
...
...
what is the boost equivalent that I can use, so that when all references to palette's are released, all memory allocated in the name of palette should be freed i.e. both the single (palette[0], etc.) and double pointer (**palette) should be freed. If yes, can you please show me how?
Thanks!
Sundaram