title: How to reference data with different key in c++
body: <p>I am new to C++ and need to store a data set. The data set looks like the following</p>
  
  <pre><code>id | time | value
  01 |   1  |   1
  01 |   2  |   0
  01 |   3  |   1
  01 |   4  |   0
  01 |   5  |   1
  02 |   1  |   2
  02 |   2  |   3
  02 |   3  |   7
  02 |   4  |   9
  02 |   5  |   5
  </code></pre>
  
  <p>I would like to be able to search the data either by <code>id</code> or by <code>time</code>, i.e.</p>
  
  <pre><code>GetValueByID(data, '01')
  # id | time | value
  # 01 |   1  |   1
  # 01 |   2  |   0
  # 01 |   3  |   1
  # 01 |   4  |   0
  # 01 |   5  |   1
  
  GetValueByID(data, '2')
  # id | time | value
  # 01 |   2  |   0
  # 02 |   2  |   3
  </code></pre>
  
  <p>What would be the most memory efficient way of doing this?
  Thank you!</p>