title: How to store an int and boolean as a pair
body: <p>We have a number of properties in several classes where the property is presently an int and a boolean. The int is the value and the boolean is true if that int has been set.</p>
  
  <p>We need this pairing because we are representing an object that has levels of properties where if it is not set at one level, it uses the setting at the level above. This approach lets us record at each level what its value is and if it was set at that level or inherited.</p>
  
  <p>It works great. However we can end up with literally 100,000 of these objects. And that's a ton of memory, a ton of garbage collection, etc. So, any ideas how we can somehow do this better. We looked at an array of ints and booleans with enums as the index. But that feels really awkward, which generally means more opportunities to get something wrong (ie introduce bugs).</p>
  
  <p>Any suggestions?</p>
  
  <p>thanks - dave</p>