title: vector<Class> has no member "function"
body: <p>I have two classes (Vector3 is an irrelevant class here):</p>
  
  <pre><code>class Room {
    public:
      Room();
  
    private:
      vector&lt;Button&gt; roombuttons[3];
  };
  </code></pre>
  
  <p>and </p>
  
  <pre><code>class Button {
    public:
      Button();
      Button(Vector3 pos);
  
      void SetPos(Vector3 pos);
  
    private:
      Vector3 pos;
  }
  </code></pre>
  
  <p>If I want to define <code>Room()</code> as:</p>
  
  <pre><code>Room::Room() { 
    roombuttons[0].SetPos(100,100,0);
  }
  </code></pre>
  
  <p>I get an error saying <code>class "std::vector&lt;Button, std::allocator&lt;Button&gt;&gt;" has no member "SetPos"</code>
  Why am I not able to call the <code>SetPos</code> function of the Button class on Button instances in a vector?</p>
  
  <p>I want to have a Room instance with a couple Buttons that are stored in some kind of array so that I can use them like elements of an array.</p>