title: How would you implement attribute lists?
body: <p>When speaking about attribute lists I mean a generic list which stores additional information for a class.</p>
  
  <p>The simplest case:<br>
  A class has a <code>std::map&lt;std::string, std::string&gt;</code>. The first string names the attribute (like <code>"Color"</code>), the second string describes the value (like <code>"Yellow"</code>).<br>
  In this example another class which uses these attributes needs to check if a certain attribute-name is existing in the map and then parse the value.<br>
  However this isn't the best concept when talking about performance.</p>
  
  <p><em>How would you implement such an attribute list?<br>
  Are there any design patterns or libraries which just do something like that?</em></p>
  
  <p>I'm especially interested in a C++-way of doing this, but if there are language-independant solutions, please post them too.</p>
  
  <p>An attribute list could be used in cases where a class needs to have dynamic attributes and the user does not want to inherit for each attribute.<br>
  If that helps, you could check my other question relating to that topic:<br>
  <a href="https://stackoverflow.com/questions/3959953/attribute-lists-or-inheritance-jungle">Attributelists or inheritance jungle?</a></p>
  
  <p>EDIT:<br>
  Of course I forgot some information (thanks to the comments):<br>
  The attributes could be applied to objects. There could be different attributes for objects of the same class. The attributes an object has can change (the value can change, there could be attributes added/removed)<br>
  Hope this clearifies it a bit.</p>