Quote Originally Posted by MrViggy View Post
You can do it that way. Access the members with the '->' operator, or:
Code:
int someVal = (*inTetr)[3];
Another options is to enclose this section in it's own block:
Code:
int main()
{
   int someVal = 0;
   {
      std::vector<int> someVec;
      ...
   }
   // someVec is now out of scope, and destroyed
}
Viggy
Ah, okay. That's a head-slapper. I was using the reference operator, but I wasn't placing the parentheses. Though it makes perfect sense why that would be necessary.

I knew about the swap trick, but that just felt...dirty somehow. I wanted to completely delete the vector.