title: Most efficient way to index true/false values in C++
body: <p>I have a list of unsigned shorts that act as local IDs for a database. I was wondering what is the most memory-efficient way to store allowed IDs. For the lifetime of my project, the allowed ID list will be dynamic, so it may have more true or more false allowed IDs as time goes on, with a range of none allowed or all allowed.</p>
  <p>What would be the best method to store these? I've considered the following:</p>
  <ol>
  <li>List of allowed IDs</li>
  <li>Bool vector/array of true/false for allowed IDs</li>
  <li>Byte array that can be iterated through, similar to 2</li>
  </ol>
  <p>Let me know which of these would be best or if another, better method, exists.</p>
  <p>Thanks</p>
  <p>EDIT: If possible, can a vector have a value put at say, index 1234, without all 1233 previous values, or would this suit a map or similar type more?
  I'm looking at using an Arduino with 2k total ram and using external storage to assist with managing a large block of data, but I'm exploring what my options are</p>