The above returns a copy of the first element in the vector. You want to return (and store) either a reference or pointer to the first element in the vector. The fact that this isn't immediately obvious to you indicates that you're still at a very early stage in learning C++. You need to learn C++ first before you start trying to learn how to use OpenGL (or anything else) in a C++ program.
Originally Posted by doctorzeus