Originally Posted by
whiteflags
So let's say I have obj foo which is your array class. I also have bar, which is an element that I want to shift in by n places. I don't think you should use a shift operator here because it's a bit awkward.
I mean this is going to be common right?
foo >> n; // make a hole
foo[n] = bar;
Why not just make that a member function instead? It's obvious what shiftIntoPlace(bar, n); does. And you cannot possibly forget to assign something in the hole. Sorry if that is strange advice, but this is how I would write it; mainly so that I can guarantee that there is only empty space at the end of the array. Your way is a kludge to me.