legends2k <rmsundaram@gmail.com> wrote:
I've writing a container class as a replacement for raw arrays; just
called it smart_array (bare with me if it's dumb), which has the
niceties of a vector, can be used for dynamic memory requirements and
cleans up itself safely. When I showed it to my friends for a review
and to point out flaws & possible bugs in some peculiar use case; they
said I could post it here to get it reviewed/constructively criticized
by many C++ stalwarts. So am presenting it here:
Am I understanding correctly that basically the only thing this class
is doing, is providing a shortcut so that instead of having to write eg:
std::vector<std::vector<std::vector<int> > > vec3d;
you can write:
smart_array<int, 3> vec3d;
?
(Well, besides providing only operator[] and nothing else that std::vector
provides...)
It raises the question whether being able to declare multi-dimensional
vectors with a slightly shorter syntax is worth throwing away all the
member functions that std::vector offers...
.... of objects to implement an N-D array in the first place. Just