a.myVector().head()
will not work because myVector
is private to the outside world, only code inside of ListofArrays
(or friend
s of ListofArrays
) can access it.
a.head()
will work only if ListofArrays
exposes its own public head()
method, eg:
class ListofArrays
{
private:
vector myVector;
public:
Type head();
};
Type ListofArrays::head()
{
return myVector.head();
}