title: Is it unefficient to use a std::vector when it only contains two elements?
body: <p>I am building a C++ class <code>A</code> that needs to contain a bunch of pointers to other objects <code>B</code>. </p>
  
  <p>In order to make the class as general as possible, I am using a <code>std::vector&lt;B*&gt;</code> inside this class. This way any number of different <code>B</code> can be held in <code>A</code> (there are no restrictions on how many there can be). </p>
  
  <p>Now this might be a bit of overkill because most of the time, I will be using objects of type <code>A</code> that only hold either 2 or 4 <code>B*</code>'s in the vector. </p>
  
  <p>Since there is going to be a lot of iterative calculations going on, involving objects of class <code>A</code>, I was wondering if there is a lot of overhead involved in using a vector of <code>B</code>'s when there are only two <code>B</code>'s needed.</p>
  
  <p>Should I overload the class to use another container when there are less than 3 <code>B</code> present?</p>
  
  <p><em>to make things clearer:</em> <code>A</code> <em>are multipoles and</em> <code>B</code> <em>are magnetic coils, that constitute the multipoles</em></p>